heheng
7 天以前 d8012ee77b6a9e86611aae9074d5925826f4210d
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
package com.gkhy.exam.common.exception;
 
import com.gkhy.exam.common.api.IErrorCode;
 
/**
 * 自定义API异常
 */
public class ApiException extends RuntimeException{
    private IErrorCode errorCode;
 
    public ApiException(IErrorCode errorCode) {
        super(errorCode.getMessage());
        this.errorCode = errorCode;
    }
 
    public ApiException(String message) {
        super(message);
    }
 
    public ApiException(Throwable cause) {
        super(cause);
    }
 
    public ApiException(String message, Throwable cause) {
        super(message, cause);
    }
 
    public IErrorCode getErrorCode() {
        return errorCode;
    }
}