Merge pull request #831 from teloxide/not_found_into_unathorized

Fix deserialization of invalid token error
This commit is contained in:
Sima Kinsart 2023-02-04 05:49:15 +06:00 committed by GitHub
commit 38575de126
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -100,8 +100,9 @@ pub enum ApiError {
BotBlocked, BotBlocked,
/// Occurs when the bot token is incorrect. /// Occurs when the bot token is incorrect.
#[serde(rename = "Not Found")] // FIXME: rename this to something akin "InvalidToken"
#[error("Not Found")] #[serde(rename = "Unauthorized")]
#[error("Unauthorized")]
NotFound, NotFound,
/// Occurs when bot tries to modify a message without modification content. /// Occurs when bot tries to modify a message without modification content.