提交 | 用户 | 时间
|
722af2
|
1 |
package com.dl.common.exception; |
X |
2 |
|
|
3 |
/** |
|
4 |
* 全局异常 |
|
5 |
* |
|
6 |
* @author dl |
|
7 |
*/ |
|
8 |
public class GlobalException extends RuntimeException { |
|
9 |
|
|
10 |
private static final long serialVersionUID = 1L; |
|
11 |
|
|
12 |
/** |
|
13 |
* 错误提示 |
|
14 |
*/ |
|
15 |
private String message; |
|
16 |
|
|
17 |
/** |
|
18 |
* 错误明细,内部调试错误 |
|
19 |
* <p> |
|
20 |
* 和 {@link CommonResult#getDetailMessage()} 一致的设计 |
|
21 |
*/ |
|
22 |
private String detailMessage; |
|
23 |
|
|
24 |
/** |
|
25 |
* 空构造方法,避免反序列化问题 |
|
26 |
*/ |
|
27 |
public GlobalException() { |
|
28 |
} |
|
29 |
|
|
30 |
public GlobalException(String message) { |
|
31 |
this.message = message; |
|
32 |
} |
|
33 |
|
|
34 |
public String getDetailMessage() { |
|
35 |
return detailMessage; |
|
36 |
} |
|
37 |
|
|
38 |
public GlobalException setDetailMessage(String detailMessage) { |
|
39 |
this.detailMessage = detailMessage; |
|
40 |
return this; |
|
41 |
} |
|
42 |
|
|
43 |
@Override |
|
44 |
public String getMessage() { |
|
45 |
return message; |
|
46 |
} |
|
47 |
|
|
48 |
public GlobalException setMessage(String message) { |
|
49 |
this.message = message; |
|
50 |
return this; |
|
51 |
} |
|
52 |
} |