Add RFC 8040 compliant error handler
[ccsdk/apps.git] / services / src / main / java / org / onap / ccsdk / apps / services / RestTransportError.java
1 package org.onap.ccsdk.apps.services;
2
3 import com.fasterxml.jackson.annotation.JsonProperty;
4 import com.fasterxml.jackson.annotation.JsonRootName;
5 import com.fasterxml.jackson.annotation.JsonValue;
6
7
8 @JsonRootName(value = "error")
9 public class RestTransportError extends RestError {
10
11
12     public RestTransportError() {
13         this.errorType = "transport";
14     }
15
16     public RestTransportError(String errorTag, String errorMessage) {
17         this.errorType = "transport";
18         this.errorTag = errorTag;
19         this.errorMessage = errorMessage;
20         this.errorInfo = errorMessage;
21     }
22
23     public RestTransportError(String errorTag, String errorMessage, Throwable t) {
24         this.errorType = "transport";
25         this.errorTag = errorTag;
26         this.errorMessage = errorMessage;
27         this.errorInfo = t.getLocalizedMessage();
28     }
29
30 }