add the ServiceException Constructor(httpcode and message)
authortian.ming@huawei.com <tian.ming@huawei.com>
Fri, 23 Sep 2016 02:32:44 +0000 (10:32 +0800)
committertian.ming@huawei.com <tian.ming@huawei.com>
Fri, 23 Sep 2016 02:32:44 +0000 (10:32 +0800)
Change-Id: I335a3a7a40085b56c74af0ce135a317aa60ecd33
Signed-off-by: tian.ming@huawei.com <tian.ming@huawei.com>
rest-client/src/main/java/org/openo/baseservice/remoteservice/exception/ServiceException.java

index 91f6acf..378fe9f 100644 (file)
@@ -114,6 +114,21 @@ public class ServiceException extends Exception {
         this.setId(id);
         this.setHttpCode(httpCode);
     }
+    
+    /**
+     * Constructor<br/>
+     * <p>
+     * the exception include the httpcode and message.
+     * </p>
+     * 
+     * @since
+     * @param httpCode http code.
+     * @param message details.
+     */
+    public ServiceException(final int httpCode, final String message) {
+        super(message);
+        this.setHttpCode(httpCode);
+    }
 
     /**
      * Constructor<br/>