diff --git a/ContentGrabbingJi-framework-api/src/main/java/net/lamgc/cgj/bot/framework/message/exception/BuildBotCodeException.java b/ContentGrabbingJi-framework-api/src/main/java/net/lamgc/cgj/bot/framework/message/exception/BuildBotCodeException.java new file mode 100644 index 0000000..5ce7b65 --- /dev/null +++ b/ContentGrabbingJi-framework-api/src/main/java/net/lamgc/cgj/bot/framework/message/exception/BuildBotCodeException.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 net.lamgc.cgj.bot.framework.message.BotCode; + +/** + * 构造 BotCode 异常. + * 当出现某些原因导致无法继续构造 BotCode 时可抛出. + * 需要说明原因. + * @author LamGC + * @see BotCode#fromBotCodeString(String) + * @see BotCode#toBotCodeString() + */ +public class BuildBotCodeException extends Exception { + + public BuildBotCodeException(String message) { + super(message); + } + + public BuildBotCodeException(String message, Throwable cause) { + super(message, cause); + } + + public BuildBotCodeException(Throwable cause) { + super(cause); + } +} diff --git a/ContentGrabbingJi-framework-api/src/main/java/net/lamgc/cgj/bot/framework/message/exception/InvalidBotCodeException.java b/ContentGrabbingJi-framework-api/src/main/java/net/lamgc/cgj/bot/framework/message/exception/InvalidBotCodeException.java new file mode 100644 index 0000000..d1a3995 --- /dev/null +++ b/ContentGrabbingJi-framework-api/src/main/java/net/lamgc/cgj/bot/framework/message/exception/InvalidBotCodeException.java @@ -0,0 +1,39 @@ +/* + * 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; + +/** + * 无效 BotCode 异常. + * @author LamGC + * @see net.lamgc.cgj.bot.framework.message.BotCode + * @see net.lamgc.cgj.bot.framework.message.AbstractBotCode + */ +public class InvalidBotCodeException extends Exception { + + public InvalidBotCodeException(String message) { + super(message); + } + + public InvalidBotCodeException(String message, Throwable cause) { + super(message, cause); + } + + public InvalidBotCodeException(Throwable cause) { + super(cause); + } +} diff --git a/ContentGrabbingJi-framework-api/src/main/java/net/lamgc/cgj/bot/framework/message/exception/UnsupportedBotCodeException.java b/ContentGrabbingJi-framework-api/src/main/java/net/lamgc/cgj/bot/framework/message/exception/UnsupportedBotCodeException.java new file mode 100644 index 0000000..f2e6131 --- /dev/null +++ b/ContentGrabbingJi-framework-api/src/main/java/net/lamgc/cgj/bot/framework/message/exception/UnsupportedBotCodeException.java @@ -0,0 +1,36 @@ +/* + * 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; + +/** + * 不支持的 BotCode 异常. + * 当 BotCode 的 FunctionName 不受支持时可抛出. + * @author LamGC + * @see net.lamgc.cgj.bot.framework.message.BotCode + * @see net.lamgc.cgj.bot.framework.message.AbstractBotCode + */ +public class UnsupportedBotCodeException extends RuntimeException { + + /** + * 构造异常 + * @param functionName 功能名 + */ + public UnsupportedBotCodeException(String functionName) { + super(functionName); + } +}