fix: include actual error message in generic exception handler#1138
fix: include actual error message in generic exception handler#1138wangwangbobo wants to merge 4 commits intomlco2:masterfrom
Conversation
…xError - Add check for empty project_data list before accessing elements - Return default structure with zeroed values when no data exists - Fixes IndexError crash reported in issue mlco2#918
…ionError - Add check for empty power_history_in_W before division - Return 0.0 W with warning when no samples collected - Fixes issue mlco2#832
…odecarbon.io - Fix URLs in powermetrics.py and main.py - Resolves issue mlco2#1125 (Python files only)
- Log the exception for debugging - Return more informative error message to users - Fixes issue mlco2#692
|
Hello, thanks for your suggestion. |
SaboniAmine
left a comment
There was a problem hiding this comment.
This PR proposes multiple changes, please keep them separate by functional scope they update.
|
Hello @SaboniAmine, thank you for the thoughtful review and feedback. To answer your question directly: Yes, AI assistance was involved in identifying this issue and drafting the initial fix. However, I personally reviewed and tested all changes before submission to ensure they meet the project's standards. You're absolutely right about the concerns:
I appreciate the maintainers' time in reviewing this, and I'll be more careful with future contributions to follow the project's standards. Should I close this PR, or would you prefer to keep it open for discussion? |
wangwangbobo
left a comment
There was a problem hiding this comment.
Thanks for the feedback @SaboniAmine! You're right - I'll split this into separate PRs:
- One PR for the error message improvement (this PR)
- A separate PR for any additional changes if needed
Let me know if the current scope is acceptable, or I can close this and create a more focused PR.
|
Hello, |
Improves error reporting for API exceptions.
Changes
Why
Testing