From fc2b873c94d059f414a2566d4262be14e6a81cd4 Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Wed, 1 Feb 2023 17:12:33 +0400 Subject: [PATCH] Fix deserialization of invalid token error --- crates/teloxide-core/src/errors.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/teloxide-core/src/errors.rs b/crates/teloxide-core/src/errors.rs index 1ace34b3..41acffdf 100644 --- a/crates/teloxide-core/src/errors.rs +++ b/crates/teloxide-core/src/errors.rs @@ -100,8 +100,9 @@ pub enum ApiError { BotBlocked, /// Occurs when the bot token is incorrect. - #[serde(rename = "Not Found")] - #[error("Not Found")] + // FIXME: rename this to something akin "InvalidToken" + #[serde(rename = "Unauthorized")] + #[error("Unauthorized")] NotFound, /// Occurs when bot tries to modify a message without modification content.