MISC: Added CommandErrorException's constructor. 33/16933/1
authorTaeyoung Son <taeyoung2.son@samsung.com>
Thu, 27 Feb 2014 07:22:34 +0000 (16:22 +0900)
committerTaeyoung Son <taeyoung2.son@samsung.com>
Thu, 27 Feb 2014 07:22:34 +0000 (16:22 +0900)
Change-Id: I005836cc13d7c8fbd9337ce35f5755a13e8150b5

org.tizen.common/src/org/tizen/common/sdb/command/message/CommandErrorException.java
org.tizen.common/src/org/tizen/common/sdb/command/message/PkgcmdErrorType.java

index 00bf22d..9b6d4e3 100644 (file)
@@ -29,6 +29,7 @@ package org.tizen.common.sdb.command.message;
 public class CommandErrorException extends Exception {
 
     private static final long serialVersionUID = 1L;
+    private ErrorMessageType errorType;
     
     public CommandErrorException() {
         super();
@@ -45,4 +46,13 @@ public class CommandErrorException extends Exception {
     public CommandErrorException(Throwable t) {
         super(t);
     }
+
+    public CommandErrorException(ErrorMessageType errorType, String msg) {
+        super(msg);
+        this.errorType = errorType;
+    }
+    
+    public ErrorMessageType getErrorType() {
+        return this.errorType;
+    }
 }
index ccfeef2..29da245 100644 (file)
@@ -88,7 +88,7 @@ public class PkgcmdErrorType implements CommandErrorType {
             throw new CommandErrorException(PkgcmdErrorMessages.ERROR_UNKNOWN);
         }
         else if (!ErrorMessageType.SUCCESS.equals(errorType)) {
-            throw new CommandErrorException(getMessage());
+            throw new CommandErrorException(errorType, getMessage());
         }
     }