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;
|
}
|
}
|