tgbot-cpp
Loading...
Searching...
No Matches
TgBot::TgException Class Reference

Exception type which is only thrown when Telegram refuses API request. More...

#include <TgException.h>

Inheritance diagram for TgBot::TgException:

Public Types

enum class  ErrorCode : size_t {
  Undefined = 0 , BadRequest = 400 , Unauthorized = 401 , Forbidden = 403 ,
  NotFound = 404 , Flood = 429 , Internal = 500 , HtmlResponse = 100 ,
  InvalidJson = 101
}
 Enum of possible errors from Api requests. More...

Public Member Functions

 TgException (std::string_view description, ErrorCode errorCode, std::shared_ptr< ResponseParameters > parameters=nullptr)

Public Attributes

const ErrorCode errorCode
const std::shared_ptr< ResponseParameters > parameters
 Additional details about the error returned by Telegram, if any.

Detailed Description

Exception type which is only thrown when Telegram refuses API request.

Definition at line 17 of file TgException.h.

Member Enumeration Documentation

◆ ErrorCode

enum class TgBot::TgException::ErrorCode : size_t
strong

Enum of possible errors from Api requests.

Enumerator
Undefined 
BadRequest 
Unauthorized 
Forbidden 
NotFound 
Flood 
Internal 
HtmlResponse 
InvalidJson 

Definition at line 22 of file TgException.h.

Constructor & Destructor Documentation

◆ TgException()

TgBot::TgException::TgException ( std::string_view description,
ErrorCode errorCode,
std::shared_ptr< ResponseParameters > parameters = nullptr )

Member Data Documentation

◆ errorCode

const ErrorCode TgBot::TgException::errorCode

Definition at line 37 of file TgException.h.

◆ parameters

const std::shared_ptr<ResponseParameters> TgBot::TgException::parameters

Additional details about the error returned by Telegram, if any.

Definition at line 42 of file TgException.h.


The documentation for this class was generated from the following file: