提交 | 用户 | 时间
|
fd2207
|
1 |
package com.jcdm.common.exception; |
懒 |
2 |
|
|
3 |
/** |
|
4 |
* 全局异常 |
|
5 |
* |
|
6 |
* @author jc |
|
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 |
* |
|
20 |
* 和 {@link CommonResult#getDetailMessage()} 一致的设计 |
|
21 |
*/ |
|
22 |
private String detailMessage; |
|
23 |
|
|
24 |
/** |
|
25 |
* 空构造方法,避免反序列化问题 |
|
26 |
*/ |
|
27 |
public GlobalException() |
|
28 |
{ |
|
29 |
} |
|
30 |
|
|
31 |
public GlobalException(String message) |
|
32 |
{ |
|
33 |
this.message = message; |
|
34 |
} |
|
35 |
|
|
36 |
public String getDetailMessage() |
|
37 |
{ |
|
38 |
return detailMessage; |
|
39 |
} |
|
40 |
|
|
41 |
public GlobalException setDetailMessage(String detailMessage) |
|
42 |
{ |
|
43 |
this.detailMessage = detailMessage; |
|
44 |
return this; |
|
45 |
} |
|
46 |
|
|
47 |
@Override |
|
48 |
public String getMessage() |
|
49 |
{ |
|
50 |
return message; |
|
51 |
} |
|
52 |
|
|
53 |
public GlobalException setMessage(String message) |
|
54 |
{ |
|
55 |
this.message = message; |
|
56 |
return this; |
|
57 |
} |
|
58 |
} |