BusinessException.java
974 Bytes
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
package org.nafmii.exception;
import javax.servlet.http.HttpServletResponse;
public class BusinessException extends RuntimeException {
private static final long serialVersionUID = 1L;
private Integer statusCode;
public BusinessException() {
super ();
this.statusCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
}
public BusinessException(String message) {
super (message);
this.statusCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
}
public BusinessException(Integer statusCode, String message) {
super (message);
this.statusCode = statusCode;
}
public BusinessException(Long statusCode, String message) {
super (message);
this.statusCode = Integer.parseInt(statusCode.toString());
}
public Integer getStatusCode() {
return statusCode;
}
public void setStatusCode(Integer statusCode) {
this.statusCode = statusCode;
}
}