liusheng
4 天以前 0bbbd746e8c39d91ad7b47a4e36e29ab972dc98c
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
package com.ruoyi.message;
 
/**
 * 发送方异常。
 * <p>
 * 旧代码在发送失败时直接抛 {@code new BaseException("短信发送失败")},为了保持行为一致,
 * 本模块提供同语义的运行时异常,由调用方决定是否转换。
 */
public class SendException extends RuntimeException {
 
    private static final long serialVersionUID = 1L;
 
    /**
     * 发送方 key
     */
    private final String senderKey;
 
    /**
     * 第三方原始响应
     */
    private final String rawResponse;
 
    public SendException(String message) {
        this(null, message, null);
    }
 
    public SendException(String senderKey, String message, String rawResponse) {
        super(message);
        this.senderKey = senderKey;
        this.rawResponse = rawResponse;
    }
 
    public SendException(String senderKey, String message, String rawResponse, Throwable cause) {
        super(message, cause);
        this.senderKey = senderKey;
        this.rawResponse = rawResponse;
    }
 
    public String getSenderKey() {
        return senderKey;
    }
 
    public String getRawResponse() {
        return rawResponse;
    }
}