diff --git a/ContentGrabbingJi-framework-api/src/main/java/net/lamgc/cgj/bot/framework/message/exception/NoSuchSenderException.java b/ContentGrabbingJi-framework-api/src/main/java/net/lamgc/cgj/bot/framework/message/exception/NoSuchSenderException.java new file mode 100644 index 0000000..aed99be --- /dev/null +++ b/ContentGrabbingJi-framework-api/src/main/java/net/lamgc/cgj/bot/framework/message/exception/NoSuchSenderException.java @@ -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 . + */ + +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); + } +} diff --git a/ContentGrabbingJi-framework-api/src/main/java/net/lamgc/cgj/bot/framework/message/exception/UploadImageException.java b/ContentGrabbingJi-framework-api/src/main/java/net/lamgc/cgj/bot/framework/message/exception/UploadImageException.java new file mode 100644 index 0000000..3788d5b --- /dev/null +++ b/ContentGrabbingJi-framework-api/src/main/java/net/lamgc/cgj/bot/framework/message/exception/UploadImageException.java @@ -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 . + */ + +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); + } +}