Skip to content
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

Incorrect parameters in the error handler for TextInput in documentation #444

Open
serikurazmaxambetov2 opened this issue Nov 27, 2024 · 0 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@serikurazmaxambetov2
Copy link

Problem Description:

In the official documentation example for the TextInput widget in aiogram_dialog, the error handler is defined as follows:

async def error(
    message: Message,
    dialog_: Any,
    manager: DialogManager,
    error_: ValueError
):
    await message.answer("Age must be a number!")

However, this appears to use incorrect parameters. According to the expected behavior for the on_error handler in the TextInput widget, the correct parameters should include:

  • widget instead of dialog_
  • data for additional context.

Proposed Solution

async def error(
    message: Message,
    widget: Any,
    manager: DialogManager,
    data: dict
):
    await message.answer("Age must be a number!")

Additional Information:

This issue is based on the example provided in the documentation for the TextInput widget. If I have misunderstood how the parameters are intended to work, I would appreciate clarification.

P.S. This issue is related to documentation.

@Tishka17 Tishka17 added bug Something isn't working documentation Improvements or additions to documentation labels Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants