mirror of
https://github.com/LamGC/ContentGrabbingJi.git
synced 2025-04-30 06:37:36 +00:00
[Add] Framework-API 补充三个异常类;
[Add] BuildBotCodeException, InvalidBotCodeException, UnsupportedBotCodeException 添加三种与功能码相关的异常类;
This commit is contained in:
parent
8dfaa97040
commit
48d51b9da5
@ -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 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);
|
||||||
|
}
|
||||||
|
}
|
@ -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 <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
@ -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 <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user