fix: narrow broad Exception in banktransfer CSV hint import#2764
fix: narrow broad Exception in banktransfer CSV hint import#2764MEGHANA660 wants to merge 2 commits intofossasia:devfrom
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideNarrowed a previously broad File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider using
logger.exception(orlogger.error(..., exc_info=True)) in the exception handler so that the traceback is preserved for easier debugging while still narrowing the caught exception types.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider using `logger.exception` (or `logger.error(..., exc_info=True)`) in the exception handler so that the traceback is preserved for easier debugging while still narrowing the caught exception types.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
Link the issue this PR solve in the description |
|
Thanks for your contribution and for looking into this cleanup. We are closing this PR for now because there is no linked issue describing a concrete bug, use case, or expected behavior. I reviewed the actual diff. This PR only changes the exception handling in While narrowing broad exception handling can be a good improvement in principle, in this case there is no issue documenting:
Without that context, this becomes a speculative cleanup rather than an issue-driven fix, and it is difficult to review safely. Please feel welcome to open an issue first describing the exact problem and expected outcome. After that, a new focused PR linked to the issue would be much easier to review and merge. Thanks again for the effort and looking forward to a follow-up contribution. |
Problem
process_csv_hint()inbanktransfer/views.pyhad a broadexcept Exceptionwith a TODO to narrow it down.Fix
Replaced with
except (ValueError, TypeError)which coversthe realistic failure cases when saving CSV hint settings.
Also removed the redundant
passstatement.Changes
app/eventyay/plugins/banktransfer/views.py: Narrowedbroad exception in process_csv_hint()
Summary by Sourcery
Narrow exception handling for CSV hint processing in the bank transfer plugin to handle only expected errors when saving settings.
Bug Fixes:
Enhancements: