admin
2021-06-30 a3304721c2e45e0f2ebd3139fdd623353f2ac72a
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
package com.ks.lijin.exception;
 
import com.ks.lib.common.exception.BaseException;
 
import java.util.Map;
 
public class TaoKeApiException extends BaseException {
    // 淘宝APPkey的请求限制
    public static final int CODE_APPKEY_LIMIT = 1;
    // 无可用app
    public static final int CODE_NO_USE = 2;
    // api请求错误
    public static final int CODE_API_ERROR = 3;
    // 其他错误
    public static final int CODE_OTHER = 4;
 
 
 
 
    private int code;
    private String msg;
 
    private Map<String, String> params;
 
    public Map<String, String> getParams() {
        return params;
    }
 
    public void setParams(Map<String, String> params) {
        this.params = params;
    }
 
    public int getCode() {
        return code;
    }
 
    public void setCode(int code) {
        this.code = code;
    }
 
    public String getMsg() {
        return msg;
    }
 
    public void setMsg(String msg) {
        this.msg = msg;
    }
 
    public TaoKeApiException() {
 
    }
 
    public TaoKeApiException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
 
    public TaoKeApiException(int code, String msg, Map<String, String> params) {
        this.code = code;
        this.msg = msg;
        this.params = params;
    }
 
    @Override
    public String getMessage() {
        return String.format("错误码为:%s  错误信息为:%s", code + "", msg);
    }
    //屏蔽堆栈信息
    @Override
    public synchronized Throwable fillInStackTrace() {
        return this;
    }
}