tgbot-cpp
Loading...
Searching...
No Matches
TgException.h
Go to the documentation of this file.
1#pragma once
2
3#include "tgbot/export.h"
4
5#include <stdexcept>
6#include <string>
7
8namespace TgBot {
9
15class TGBOT_API TgException : public std::runtime_error {
16public:
20 enum class ErrorCode : size_t {
21 Undefined = 0,
22 BadRequest = 400,
23 Unauthorized = 401,
24 Forbidden = 403,
25 NotFound = 404,
26 Flood = 429,
27 Internal = 500,
28 HtmlResponse = 100,
29 InvalidJson = 101
30 };
31
32 TgException(const std::string& description, ErrorCode errorCode);
33
35};
36
37} // namespace TgBot
const ErrorCode errorCode
Definition TgException.h:34
ErrorCode
Enum of possible errors from Api requests.
Definition TgException.h:20
TgException(const std::string &description, ErrorCode errorCode)
#define TGBOT_API
Definition export.h:5
Definition Api.h:17