-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFacturapiException.java
More file actions
83 lines (70 loc) · 1.97 KB
/
Copy pathFacturapiException.java
File metadata and controls
83 lines (70 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package io.facturapi;
import com.fasterxml.jackson.databind.JsonNode;
import java.util.Collections;
import java.util.List;
import java.util.Map;
public class FacturapiException extends RuntimeException {
private final int statusCode;
private final String errorCode;
private final String errorPath;
private final String errorLocation;
private final JsonNode errors;
private final String logId;
private final Map<String, List<String>> headers;
public FacturapiException(String message) {
this(message, -1, null, null, null, null, null, Collections.emptyMap());
}
public FacturapiException(String message, Throwable cause) {
super(message, cause);
this.statusCode = -1;
this.errorCode = null;
this.errorPath = null;
this.errorLocation = null;
this.errors = null;
this.logId = null;
this.headers = Collections.emptyMap();
}
public FacturapiException(String message, int statusCode, String errorCode, String errorPath) {
this(message, statusCode, errorCode, errorPath, null, null, null, Collections.emptyMap());
}
public FacturapiException(
String message,
int statusCode,
String errorCode,
String errorPath,
String errorLocation,
JsonNode errors,
String logId,
Map<String, List<String>> headers
) {
super(message);
this.statusCode = statusCode;
this.errorCode = errorCode;
this.errorPath = errorPath;
this.errorLocation = errorLocation;
this.errors = errors;
this.logId = logId;
this.headers = headers == null ? Collections.emptyMap() : headers;
}
public int getStatusCode() {
return statusCode;
}
public String getErrorCode() {
return errorCode;
}
public String getErrorPath() {
return errorPath;
}
public String getErrorLocation() {
return errorLocation;
}
public JsonNode getErrors() {
return errors;
}
public String getLogId() {
return logId;
}
public Map<String, List<String>> getHeaders() {
return headers;
}
}