Skip to content

Add error handling example #1099

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 14, 2023
Merged

Add error handling example #1099

merged 4 commits into from
Aug 14, 2023

Conversation

Danipulok
Copy link
Contributor

@Danipulok Danipulok commented Jan 16, 2023

Add error handling example

Add error handling example examples/error_handling.py where following features used:

  • Using error handler: dp.error;
  • Using error filter: ExceptionTypeFilter;
  • Using error filter: ExceptionMessageFilter;
  • Using command object: CommandObject;
  • Getting bot instance passed to a handler;

My motivation is that currently using error handlers is not that obvious.

Type of change

  • Documentation (typos, code examples or any documentation update)

How has this been tested?

Locally.
Also, make lint was used.

Test Configuration

  • Windows 10
  • Python version: 3.10.8

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective or that my feature works as expected
  • New and existing unit tests pass locally with my changes
  • My changes generate no new warnings or errors
  • My changes are compatible with minimum requirements of the project
  • I have made corresponding changes to the documentation

@github-actions github-actions bot added the 3.x Issue or PR for stable 3.x version label Jan 16, 2023
@github-actions
Copy link

github-actions bot commented Jan 16, 2023

✔️ Changelog found.

Thank you for adding a description of the changes

@JrooTJunior
Copy link
Member

I think this information should also be added to the documentation, could you please add this to the "Handling events" section?

@JrooTJunior JrooTJunior added enhancement Make it better! docs Something is missing in docs labels Feb 11, 2023
@Danipulok
Copy link
Contributor Author

I think this information should also be added to the documentation, could you please add this to the "Handling events" section?

@JrooTJunior good day. I will add documentation during this week, thanks for checking the PR

@JrooTJunior
Copy link
Member

@JrooTJunior good day. I will add documentation during this week, thanks for checking the PR

Any news?

@JrooTJunior JrooTJunior merged commit 16649ec into aiogram:dev-3.x Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Issue or PR for stable 3.x version docs Something is missing in docs enhancement Make it better!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants