Helius
2021-01-26 cde91db7a91dbd1406b3eb700880ff8343de7ccb
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package com.matrix.core.exception;
 
import com.matrix.core.tools.InternationaUtil;
 
/**
 * @description 系统异常类
 * @author 姜友瑶
 * @email 935090232@qq.com
 * @date 2016-06-26
 */
public class GlobleException extends RuntimeException {
 
    private static final long serialVersionUID = 5538900603076485646L;
 
    private String errorCode;
 
    /**
     * 带堆栈信息
     * 
     * @author JIANGYOUYAO
     * @email 935090232@qq.com
     * @date 2017年11月28日
     * @param errorCode
     * @param cause
     * @param param
     */
    public GlobleException(String errorCode, Throwable cause, Object... param) {
        super(getErrorMsg(errorCode, param), cause);
        this.errorCode = errorCode;
 
    }
 
    /**
     * 不带堆栈
     * 
     * @author JIANGYOUYAO
     * @email 935090232@qq.com
     * @date 2017年11月28日
     * @param errorCode
     * @param param
     */
    public GlobleException(String errorCode, Object... param) {
        super(getErrorMsg(errorCode, param), null);
        this.errorCode = errorCode;
 
    }
 
    /**
     * 不对堆栈,不带参数
     * 
     * @author JIANGYOUYAO
     * @email 935090232@qq.com
     * @date 2017年11月28日
     * @param errorCode
     */
    public GlobleException(String errorCode) {
        super(getErrorMsg(errorCode), null);
        this.errorCode = errorCode;
    }
 
    private static String getErrorMsg(String errorCode, Object... param) {
        String message = InternationaUtil.getMesssge(errorCode, param);
        return message;
    }
 
    public String getErrorCode() {
        return errorCode;
    }
 
    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }
    
    
    
 
}