kongzy
2024-08-09 a2a1f2a22db7c2e53275359fb5f8d6c0dd15d8d6
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.assess.common.exception;
 
import com.gkhy.assess.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;
    }
}