From d1fcac7411bd0a686c3ccaa7416d98dc197c4e59 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sun, 6 Apr 2025 19:29:29 +0400 Subject: feat: lua execution error --- bot/src/commands/response_error.hpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'bot/src/commands/response_error.hpp') diff --git a/bot/src/commands/response_error.hpp b/bot/src/commands/response_error.hpp index ae2c3ee..b89d38e 100644 --- a/bot/src/commands/response_error.hpp +++ b/bot/src/commands/response_error.hpp @@ -7,6 +7,7 @@ #include #include "command.hpp" +#include "localization/line_id.hpp" #include "request.hpp" namespace bot { @@ -23,7 +24,9 @@ namespace bot { EXTERNAL_API_ERROR, INSUFFICIENT_RIGHTS, - ILLEGAL_COMMAND + ILLEGAL_COMMAND, + + LUA_EXECUTION_ERROR }; template @@ -31,9 +34,10 @@ namespace bot { template class ResponseException< - T, typename std::enable_if< - T == INCORRECT_ARGUMENT || T == INCOMPATIBLE_NAME || - T == NAMESAKE_CREATION || T == NOT_FOUND>::type> + T, typename std::enable_if::type> : public std::exception { public: ResponseException(const command::Request &request, @@ -58,6 +62,9 @@ namespace bot { case NOT_FOUND: line_id = loc::LineId::ErrorNotFound; break; + case LUA_EXECUTION_ERROR: + line_id = loc::LineId::ErrorLuaExecutionError; + break; default: line_id = loc::LineId::ErrorSomethingWentWrong; break; -- cgit v1.2.3