UniversalStatementException.java
1.49 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
package it.softecspa.fileproxy.services.common;
@SuppressWarnings("serial")
public class UniversalStatementException extends Throwable implements TraceableWithIdException {
private String id;
private boolean trace;
public UniversalStatementException(Throwable e) {
super(ResponseOutcome.INTERNAL_SERVER_ERROR.getMessage(),e);
this.id = ResponseOutcome.INTERNAL_SERVER_ERROR.getReturnCode();
this.trace = ResponseOutcome.INTERNAL_SERVER_ERROR.isTraceLog();
}
public UniversalStatementException(String message, Throwable e) {
super(message, e);
this.id = ResponseOutcome.INTERNAL_SERVER_ERROR.getReturnCode();
this.trace = ResponseOutcome.INTERNAL_SERVER_ERROR.isTraceLog();
}
public UniversalStatementException(String id, String message) {
super(message);
this.id = id;
this.trace = true;
}
public UniversalStatementException(ResponseOutcome outcome, Throwable e) {
super(outcome.getMessage(), e);
this.id = outcome.getReturnCode();
this.trace = outcome.isTraceLog();
}
public UniversalStatementException(ResponseOutcome outcome) {
super(outcome.getMessage());
this.id = outcome.getReturnCode();
this.trace = outcome.isTraceLog();
}
@Override
public String getId() {
return id;
}
@Override
public boolean isTraceLog() {
return trace;
}
@Override
public boolean isTraceErrorCall() {
return false;
}
@Override
public String getMessage() {
return super.getMessage();
}
}