summaryrefslogtreecommitdiff
path: root/include/tgbot/TgException.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/tgbot/TgException.h')
-rw-r--r--include/tgbot/TgException.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/tgbot/TgException.h b/include/tgbot/TgException.h
index e80711c..0fbda93 100644
--- a/include/tgbot/TgException.h
+++ b/include/tgbot/TgException.h
@@ -16,7 +16,21 @@ namespace TgBot {
class TGBOT_API TgException : public std::runtime_error {
public:
- explicit TgException(const std::string& description);
+
+ /**
+ * @brief Enum of possible errors from Api requests
+ */
+ enum class ErrorCode : size_t {
+ Undefined = 0,
+ BadRequest = 400, Unauthorized = 401,
+ Forbidden = 403, NotFound = 404,
+ Flood = 402, Internal = 500,
+ HtmlResponse = 100, InvalidJson = 101
+ };
+
+ explicit TgException(const std::string& description, ErrorCode errorCode);
+
+ const ErrorCode errorCode;
};
}