aboutsummaryrefslogtreecommitdiffstats
path: root/common/src/main/java/org/onap/so/rest/exceptions/RestProcessingException.java
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/main/java/org/onap/so/rest/exceptions/RestProcessingException.java')
-rw-r--r--common/src/main/java/org/onap/so/rest/exceptions/RestProcessingException.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/common/src/main/java/org/onap/so/rest/exceptions/RestProcessingException.java b/common/src/main/java/org/onap/so/rest/exceptions/RestProcessingException.java
index e8ce00c7e5..5d62d8488a 100644
--- a/common/src/main/java/org/onap/so/rest/exceptions/RestProcessingException.java
+++ b/common/src/main/java/org/onap/so/rest/exceptions/RestProcessingException.java
@@ -26,12 +26,28 @@ package org.onap.so.rest.exceptions;
public class RestProcessingException extends RuntimeException {
private static final long serialVersionUID = 16862313537198441L;
+ private final int statusCode;
public RestProcessingException(final String message) {
super(message);
+ statusCode = 0;
}
public RestProcessingException(final String message, final Throwable cause) {
+ this(message, cause, 0);
+ }
+
+ public RestProcessingException(final String message, final Throwable cause, final int statusCode) {
super(message, cause);
+ this.statusCode = statusCode;
+ }
+
+ /**
+ * Get the status code from the response to the rest request, if available
+ *
+ * @return the status code, or 0 if not available
+ */
+ public int getStatusCode() {
+ return statusCode;
}
}