2 #include <cpr/status_codes.h>
38 CONFLICT = cpr::status::HTTP_CONFLICT,
50 INTERNAL = cpr::status::HTTP_INTERNAL_SERVER_ERROR
66 default:
return os <<
"Unknown ErrorCode (" << (std::int32_t)errorCode <<
')';
96 explicit Exception(
const std::string& errMessage,
ErrorCode errCode) : std::runtime_error(errMessage), m_errorCode(errCode) {}
Exception(const std::string &errMessage)
Exception(const std::string &errMessage, ErrorCode errCode)
ErrorCode errorCode() const noexcept
ErrorCode
https://core.telegram.org/api/errors
@ UNAUTHORIZED
There was an unauthorized attempt to use functionality available only to authorized users.
@ BAD_GATEWAY
Bad Gateway.
@ SEE_OTHER
The request must be repeated, but directed to a different data center.
@ TOO_MANY_REQUESTS
Too Many Requests: retry after X.
@ FORBIDDEN
Privacy violation. For example, an attempt to write a message to someone who has blacklisted the curr...
@ NOT_FOUND
An attempt to invoke a non-existent object, such as a method.
@ NOT_ACCEPTABLE
Similar to 400 BAD_REQUEST, but the app must display the error to the user a bit differently.
@ CONFLICT
Conflict: terminated by other long poll or webhook.
static std::ostream & operator<<(std::ostream &os, const ErrorCode &errorCode) noexcept
static bool isErrorCode(std::int32_t c) noexcept