Improve user-friendly error output for Fluent#46
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR improves error handling for Fluent translation errors by introducing a new FluentMessageError exception that aggregates multiple errors and formats them in a user-friendly way. Instead of only raising the first error encountered during Fluent message formatting, all errors are now collected and presented together with their types.
- Introduces
FluentMessageErrorexception for better error reporting - Updates both Fluent runtime and compile cores to use the new exception
- Fixes duplicate function names in example code
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/aiogram_i18n/exceptions.py | Adds new FluentMessageError exception class with formatted multi-error output |
| src/aiogram_i18n/cores/fluent_runtime_core.py | Updates error handling to raise FluentMessageError instead of first error only |
| src/aiogram_i18n/cores/fluent_compile_core.py | Updates error handling to raise FluentMessageError instead of first error only |
| examples/language_inline_markup.py | Renames duplicate function names from btn_help to btn_back and btn_lang |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
FTL file:
Before:
After: