Skip to content

Conversation

@IlyaBizyaev
Copy link
Contributor

Editing message text to the same value is an easy mistake to make, so I would like to test my code against it.

I would also like to receive the error properly as an ApiError enum variant, so this commit introduces a way for teloxide_tests actions to return standard error values of Telegram Bot API that teloxide can actually parse.

In the future, other usages of check_if_message_exists and ErrorBadRequest should also be replaced with ApiErrors where possible.

Editing message text to the same value is an easy mistake to make, so I
would like to test my code against it.

I would also like to receive the error properly as an ApiError enum
variant, so this commit introduces a way for teloxide_tests actions
to return standard error values of Telegram Bot API that teloxide
can actually parse.

In the future, other usages of check_if_message_exists and ErrorBadRequest
should also be replaced with ApiErrors where possible.
@IlyaBizyaev IlyaBizyaev force-pushed the feat/canonical-errors branch from ca963d7 to 4c4f82e Compare February 28, 2025 20:31
Copy link
Owner

@LasterAlex LasterAlex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, that is very useful! In the ideal world all of the error messages should be refactored for this, but it's a good start

@LasterAlex
Copy link
Owner

Thanks!

@LasterAlex LasterAlex merged commit 1587c0d into LasterAlex:latest-teloxide Mar 1, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants