-
Notifications
You must be signed in to change notification settings - Fork 69
Core: Improve error messages in translator modules #166
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
Core: Improve error messages in translator modules #166
Conversation
- Add file names to timeout and translation error messages - Include specific error causes and resolution hints - Add md_file_path parameter to _run_prompts_sequentially function - Improve ValueError messages for LLM provider configuration - Enhance user experience with actionable error information Part of Azure#46
- Add project name context to all error messages - Include file counts and specific error causes - Provide actionable resolution hints for API and file issues - Improve Computer Vision configuration messages - Enhance retranslation error messages with file names - Add specific guidance for common failure scenarios Part of Azure#46
- Add file names to all text detection and processing errors - Include specific error causes for bounding box issues - Provide actionable resolution hints for font and API problems - Enhance Computer Vision configuration error with specific variables - Improve user experience with detailed image processing feedback Part of Azure#46
- Test MarkdownTranslator error messages for LLM provider issues - Test ProjectTranslator Computer Vision configuration messages - Test ImageTranslator error handling and file processing - Verify improved error messages include file names and resolution hints - Add integrated scenarios for missing API services Related to Azure#46
- Format all modified files according to project standards - Ensure consistent code style across translator modules - Maintain line length and formatting requirements Part of Azure#46
|
@microsoft-github-policy-service agree |
|
Hi @DongilMin, thanks for your contribution! |
|
@skytin1004 Thanks for
@skytin1004 Thanks for the review! I'll take a look and make the updates shortly. |
090f94f to
4728fb3
Compare
|
@skytin1004 I've addressed your feedback. Could you please review when you have a chance? Thanks! |
| log_text = caplog.text | ||
| # Check the actual log message format | ||
| assert "Computer Vision not configured" in log_text | ||
| assert "AZURE_COMPUTER_VISION_KEY" in log_text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I reviewed this code and think it might be better to remove this section. We're considering adding log assertion logic to each individual scenario instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After removing this entire section, I'm planning to merge it if tests pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I reviewed this code and think it might be better to remove this section. We're considering adding log assertion logic to each individual scenario instead.
@skytin1004
I misunderstood your feedback initially! 😅
Just realized you wanted me to remove the caplog assertions entirely. Fixed it now - removed all the caplog parameters and logging checks from the error message tests.
- Removed caplog parameters and caplog.set_level() calls - Focused tests on core functionality verification - Addresses reviewer feedback to use individual scenario-based log assertions
|
Hi @DongilMin, thanks for the update and sorry for the confusion I think there's still a bit of misunderstanding: I was actually suggesting that we remove all changes made to Right now, I think it's better to completely remove this section and revisit how we want to add log assertion logic later. |
|
My current thinking is that instead of creating a separate test function solely for log message assertions, we should integrate log assertions directly into the relevant test cases, such as So for now, I'd suggest fully removing the changes to this file ( |
- Delete tests/co_op_translator/core/project/test_project_translator.py - Delete tests/co_op_translator/core/project/test_translation_manager.py
- Revert test_project_translator.py to original state - Revert test_translation_manager.py to original state
- Restore original formatting in markdown_evaluator.py - Restore original formatting in project_evaluator.py - Remove unintended formatting changes from our PR scope
@skytin1004 Thanks for the clarification!
At this point, the PR only includes the core error message improvements originally intended – no test changes, no formatting noise. |
|
@DongilMin |
|
@DongilMin Sorry I actually only meant to remove the changes in |
@skytin1004 |
| ] | ||
| is True | ||
| ) | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DongilMin
Looks great overall, thanks again for the thorough updates!
Just one small thing: it looks like this file is using CRLF line endings.
Could you please change it to LF to match the rest of the project?
If you're using VS Code, you can check this in the bottom-right corner
just click CRLF and switch to LF, then save the file. And push your changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DongilMin Looks great overall, thanks again for the thorough updates!
Just one small thing: it looks like this file is using CRLF line endings. Could you please change it to LF to match the rest of the project?
If you're using VS Code, you can check this in the bottom-right corner just click CRLF and switch to LF, then save the file. And push your changes
@DongilMin Looks great overall, thanks again for the thorough updates!
Just one small thing: it looks like this file is using CRLF line endings. Could you please change it to LF to match the rest of the project?
If you're using VS Code, you can check this in the bottom-right corner just click CRLF and switch to LF, then save the file. And push your changes
@skytin1004 I'm currently using LF endings in VS Code, and ran Black to ensure formatting is clean.
The only remaining diff is a single trailing newline at the end of the file — should I remove that as well?
Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @DongilMin, LGTM!
I went ahead and cleaned up the remaining line ending diff.
Merging this in, great work on the error message improvements!







Purpose
Improves error messages across core translator modules to provide better user experience and actionable feedback when errors occur.
Description
This PR addresses issue #46 by enhancing error messages in three main translator modules:
Changes Made:
Key Improvements:
Related Issue
Fixes #46
Does this introduce a breaking change?
Type of change
Checklist
test_error_messages.pyAdditional context
Action failed for 'filename': Specific cause. Resolution hint.