Fix: Prevent Silent Exception Swallowing in Model Loading#530
Open
priyan17singh wants to merge 1 commit intoJdeRobot:masterfrom
Open
Fix: Prevent Silent Exception Swallowing in Model Loading#530priyan17singh wants to merge 1 commit intoJdeRobot:masterfrom
priyan17singh wants to merge 1 commit intoJdeRobot:masterfrom
Conversation
Collaborator
|
Hi @priyan17singh , thanks for your contribution! Can you fix the conflicts? I'll review the PR after that |
b45d1a6 to
28eda4c
Compare
Contributor
Author
|
Hi @dpascualhe, thank you for taking the time to review! I've resolved the merge conflicts by rebasing my branch on top of the latest master and keeping the improved exception handling from this PR. The branch is now up to date — feel free to review when you get a chance! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #520
Summary
This PR fixes silent exception swallowing in model loading logic by:
assertstatements with explicit exceptionsexcept Exception:blocks🚨 Problem
The current implementation:
assertfor file validation (unsafe in production).except Exception:blocks.This makes debugging difficult and hides real failures.
Changes Made
1. Safer File Validation
2. Improved Exception Handling
3. Optional Dependency Handling
🧪 Tests Added
Added
tests/test_model_loading.pyto validate error handling behavior.✔️ Test Results
What is tested
FileNotFoundError📊 Impact