wl
2022-12-20 b4108b26e1cc01178df5180e7291213cb16b52e1
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
package com.ycl.exception;
 
 
import com.ycl.api.IErrorCode;
 
/**
 * 自定义API异常
 * Created by macro on 2020/2/27.
 */
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;
    }
}