tgbot-cpp
Toggle main menu visibility
Loading...
Searching...
No Matches
TgException.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
tgbot/Types.h
"
4
#include "
tgbot/export.h
"
5
6
#include <stdexcept>
7
#include <string>
8
#include <string_view>
9
10
namespace
TgBot
{
11
17
class
TGBOT_API
TgException
:
public
std::runtime_error {
18
public
:
22
enum class
ErrorCode
:
size_t
{
23
Undefined = 0,
24
BadRequest = 400,
25
Unauthorized = 401,
26
Forbidden = 403,
27
NotFound = 404,
28
Flood = 429,
29
Internal = 500,
30
HtmlResponse = 100,
31
InvalidJson = 101
32
};
33
34
TgException
(std::string_view description,
ErrorCode
errorCode
,
35
std::shared_ptr<ResponseParameters>
parameters
=
nullptr
);
36
37
const
ErrorCode
errorCode
;
38
42
const
std::shared_ptr<ResponseParameters>
parameters
;
43
};
44
45
}
// namespace TgBot
Types.h
TgBot::TgException::errorCode
const ErrorCode errorCode
Definition
TgException.h:37
TgBot::TgException::ErrorCode
ErrorCode
Enum of possible errors from Api requests.
Definition
TgException.h:22
TgBot::TgException::TgException
TgException(std::string_view description, ErrorCode errorCode, std::shared_ptr< ResponseParameters > parameters=nullptr)
TgBot::TgException::parameters
const std::shared_ptr< ResponseParameters > parameters
Additional details about the error returned by Telegram, if any.
Definition
TgException.h:42
export.h
TGBOT_API
#define TGBOT_API
Definition
export.h:5
TgBot
Definition
Api.h:18
include
tgbot
TgException.h
Generated on
for tgbot-cpp by
1.18.0