mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 22:46:39 +01:00
adding enum variant to handle unknown 400
This commit is contained in:
parent
10846e19fd
commit
694ae1ee85
1 changed files with 15 additions and 0 deletions
|
@ -238,6 +238,16 @@ impl_api_error! {
|
||||||
/// [`DeleteMessage`]: crate::payloads::DeleteMessage
|
/// [`DeleteMessage`]: crate::payloads::DeleteMessage
|
||||||
MessageCantBeDeleted = "Bad Request: message can't be deleted",
|
MessageCantBeDeleted = "Bad Request: message can't be deleted",
|
||||||
|
|
||||||
|
/// Occurs when a bot tries to delete a message created by the bot
|
||||||
|
/// in a group they belong to but have no rights to delete the message
|
||||||
|
/// for all in the group.
|
||||||
|
///
|
||||||
|
/// May happen in methods:
|
||||||
|
/// 1. [`DeleteMessage`]
|
||||||
|
///
|
||||||
|
/// [`DeleteMessage`]: crate::payloads::DeleteMessage
|
||||||
|
MessageCantBeDeletedForEveryone = "Bad Request: message can't be deleted for everyone",
|
||||||
|
|
||||||
/// Occurs when bot tries to edit a message which does not exists.
|
/// Occurs when bot tries to edit a message which does not exists.
|
||||||
///
|
///
|
||||||
/// May happen in methods:
|
/// May happen in methods:
|
||||||
|
@ -828,6 +838,10 @@ mod tests {
|
||||||
"{\"data\": \"Bad Request: message can't be deleted\"}",
|
"{\"data\": \"Bad Request: message can't be deleted\"}",
|
||||||
ApiError::MessageCantBeDeleted,
|
ApiError::MessageCantBeDeleted,
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
"{\"data\": \"Bad Request: message can't be deleted for everyone\"}",
|
||||||
|
ApiError::MessageCantBeDeletedForEveryone,
|
||||||
|
),
|
||||||
(
|
(
|
||||||
"{\"data\": \"Bad Request: message to edit not found\"}",
|
"{\"data\": \"Bad Request: message to edit not found\"}",
|
||||||
ApiError::MessageToEditNotFound,
|
ApiError::MessageToEditNotFound,
|
||||||
|
@ -868,6 +882,7 @@ mod tests {
|
||||||
ApiError::PollQuestionMustBeNonEmpty,
|
ApiError::PollQuestionMustBeNonEmpty,
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
|
|
||||||
"{\"data\": \"Bad Request: poll options length must not exceed 100\"}",
|
"{\"data\": \"Bad Request: poll options length must not exceed 100\"}",
|
||||||
ApiError::PollOptionsLengthTooLong,
|
ApiError::PollOptionsLengthTooLong,
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue