tgbot-cpp
Loading...
Searching...
No Matches
TgException.h
Go to the documentation of this file.
1#ifndef TGBOT_TGEXCEPTION_H
2#define TGBOT_TGEXCEPTION_H
3
4#include "tgbot/export.h"
5
6#include <string>
7#include <stdexcept>
8
9namespace TgBot {
10
16class TGBOT_API TgException : public std::runtime_error {
17
18public:
19
23 enum class ErrorCode : size_t {
24 Undefined = 0,
25 BadRequest = 400, Unauthorized = 401,
26 Forbidden = 403, NotFound = 404,
27 Flood = 402, Internal = 500,
28 HtmlResponse = 100, InvalidJson = 101
29 };
30
31 explicit TgException(const std::string& description, ErrorCode errorCode);
32
34};
35
36}
37
38#endif //TGBOT_TGEXCEPTION_H
Exception type which is only thrown when Telegram refuses API request.
Definition TgException.h:16
const ErrorCode errorCode
Definition TgException.h:33
ErrorCode
Enum of possible errors from Api requests.
Definition TgException.h:23
TgException(const std::string &description, ErrorCode errorCode)
Definition Api.h:39