[Add][Fix] Framework-API 补充提交两个异常类;

[Add] NoSuchSenderException, UploadImageException 添加两个与 MessageSender 相关的异常类;
This commit is contained in:
LamGC 2020-10-17 22:45:50 +08:00
parent 551c2097be
commit 0b6f537354
Signed by: LamGC
GPG Key ID: 6C5AE2A913941E1D
2 changed files with 83 additions and 0 deletions

View File

@ -0,0 +1,40 @@
/*
* Copyright (C) 2020 LamGC
*
* ContentGrabbingJi is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* ContentGrabbingJi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.lamgc.cgj.bot.framework.message.exception;
/**
* 无对应 Sender 异常.
* {@link net.lamgc.cgj.bot.framework.message.MessageSenderFactory} 无法返回对应 Sender 时抛出.
* @see net.lamgc.cgj.bot.framework.message.MessageSender
* @see net.lamgc.cgj.bot.framework.message.MessageSenderFactory
* @author LamGC
*/
public class NoSuchSenderException extends Exception {
public NoSuchSenderException(String message) {
super(message);
}
public NoSuchSenderException(String message, Throwable cause) {
super(message, cause);
}
public NoSuchSenderException(Throwable cause) {
super(cause);
}
}

View File

@ -0,0 +1,43 @@
/*
* Copyright (C) 2020 LamGC
*
* ContentGrabbingJi is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* ContentGrabbingJi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.lamgc.cgj.bot.framework.message.exception;
import java.io.File;
/**
* 图片上传异常.
* 当图片上传发生异常时抛出, 需附带原因.
* @author LamGC
* @see net.lamgc.cgj.bot.framework.message.MessageSender
* @see net.lamgc.cgj.bot.framework.message.MessageSender#uploadImage(File)
* @see net.lamgc.cgj.bot.framework.message.MessageSender#uploadImage(java.io.InputStream)
*/
public class UploadImageException extends Exception {
public UploadImageException(String message) {
super(message);
}
public UploadImageException(String message, Throwable cause) {
super(message, cause);
}
public UploadImageException(Throwable cause) {
super(cause);
}
}