summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rest-client/src/main/java/org/openo/baseservice/remoteservice/exception/ServiceException.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/rest-client/src/main/java/org/openo/baseservice/remoteservice/exception/ServiceException.java b/rest-client/src/main/java/org/openo/baseservice/remoteservice/exception/ServiceException.java
index 91f6acf..378fe9f 100644
--- a/rest-client/src/main/java/org/openo/baseservice/remoteservice/exception/ServiceException.java
+++ b/rest-client/src/main/java/org/openo/baseservice/remoteservice/exception/ServiceException.java
@@ -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/>