自定义异常
| 5 | * 自定义异常 |
| 6 | */ |
| 7 | public class EIException extends RuntimeException { |
| 8 | private static final long serialVersionUID = 1L; |
| 9 | |
| 10 | private String msg; |
| 11 | private int code = 500; |
| 12 | |
| 13 | public EIException(String msg) { |
| 14 | super(msg); |
| 15 | this.msg = msg; |
| 16 | } |
| 17 | |
| 18 | public EIException(String msg, Throwable e) { |
| 19 | super(msg, e); |
| 20 | this.msg = msg; |
| 21 | } |
| 22 | |
| 23 | public EIException(String msg, int code) { |
| 24 | super(msg); |
| 25 | this.msg = msg; |
| 26 | this.code = code; |
| 27 | } |
| 28 | |
| 29 | public EIException(String msg, int code, Throwable e) { |
| 30 | super(msg, e); |
| 31 | this.msg = msg; |
| 32 | this.code = code; |
| 33 | } |
| 34 | |
| 35 | public String getMsg() { |
| 36 | return msg; |
| 37 | } |
| 38 | |
| 39 | public void setMsg(String msg) { |
| 40 | this.msg = msg; |
| 41 | } |
| 42 | |
| 43 | public int getCode() { |
| 44 | return code; |
| 45 | } |
| 46 | |
| 47 | public void setCode(int code) { |
| 48 | this.code = code; |
| 49 | } |
| 50 | |
| 51 | |
| 52 | } |
nothing calls this directly
no outgoing calls
no test coverage detected