提交 | 用户 | age
|
5c5945
|
1 |
package com.hx.exception; |
E |
2 |
|
|
3 |
/** 判断异常/业务异常 |
|
4 |
* @author ChenJiaHe |
|
5 |
* @Date 2020-06-19 |
|
6 |
*/ |
|
7 |
public class ServiceException extends RuntimeException { |
|
8 |
|
|
9 |
private Integer code; |
|
10 |
|
|
11 |
public ServiceException(String message) { |
|
12 |
super(message); |
|
13 |
} |
|
14 |
|
|
15 |
public ServiceException(String message, Integer code) { |
|
16 |
super(message); |
|
17 |
this.code = code; |
|
18 |
} |
|
19 |
|
|
20 |
public ServiceException(String message, Throwable cause, Integer code) { |
|
21 |
super(message, cause); |
|
22 |
this.code = code; |
|
23 |
} |
|
24 |
|
|
25 |
public ServiceException(Throwable cause, Integer code) { |
|
26 |
super(cause); |
|
27 |
this.code = code; |
|
28 |
} |
|
29 |
|
7cbd26
|
30 |
public Integer getCode() { |
C |
31 |
return code; |
|
32 |
} |
|
33 |
|
|
34 |
public void setCode(Integer code) { |
|
35 |
this.code = code; |
5c5945
|
36 |
} |
E |
37 |
} |