mirror of
https://github.com/LamGC/ContentGrabbingJi.git
synced 2025-04-29 22:27:33 +00:00
[Add] Framework-API 为 NotFoundSenderException 异常添加新的构造器(早知道就一步到位了 :O);
[Add] NotFoundSenderException 添加新的构造器;
This commit is contained in:
parent
e494412344
commit
30b6392ce2
@ -36,7 +36,7 @@ public class NotFoundSenderException extends RuntimeException {
|
|||||||
* @param id 传入的消息源 Id.
|
* @param id 传入的消息源 Id.
|
||||||
*/
|
*/
|
||||||
public NotFoundSenderException(MessageSource source, long id) {
|
public NotFoundSenderException(MessageSource source, long id) {
|
||||||
this(source, id, null);
|
this(source, id, (String) null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -52,6 +52,30 @@ public class NotFoundSenderException extends RuntimeException {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构造异常.
|
||||||
|
* @param source 传入的消息源类型.
|
||||||
|
* @param id 传入的消息源 Id.
|
||||||
|
*/
|
||||||
|
public NotFoundSenderException(MessageSource source, long id, Throwable cause) {
|
||||||
|
super("Source Type: " + source + ", id: " + id, cause);
|
||||||
|
this.source = source;
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构造异常.
|
||||||
|
* @param source 传入的消息源类型.
|
||||||
|
* @param id 传入的消息源 Id.
|
||||||
|
*/
|
||||||
|
public NotFoundSenderException(MessageSource source, long id, String message, Throwable cause) {
|
||||||
|
super(Strings.isNullOrEmpty(message) ?
|
||||||
|
"Source Type: " + source + ", id: " + id :
|
||||||
|
message + " (" + "Source Type: " + source + ", id: " + id + ")", cause);
|
||||||
|
this.source = source;
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取引发该异常时传入的 {@link MessageSource} 类型.
|
* 获取引发该异常时传入的 {@link MessageSource} 类型.
|
||||||
* @return 返回引发该异常时提供的 MessageSource.
|
* @return 返回引发该异常时提供的 MessageSource.
|
||||||
|
Loading…
Reference in New Issue
Block a user