fix(files): raise PermanentUploadError instead of bare raise in get_uploader#6569
Open
satyamshivam13 wants to merge 1 commit into
Open
fix(files): raise PermanentUploadError instead of bare raise in get_uploader#6569satyamshivam13 wants to merge 1 commit into
satyamshivam13 wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughChangesUploader error handling
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Closes #6568
Summary
Two bare
raisestatements inget_uploader()(lib/crewai-files/src/crewai_files/uploaders/factory.py)were outside any exception handler, causing
RuntimeError: No active exception to re-raiseinstead ofa meaningful error:
Fix
Both now raise
PermanentUploadError(already defined increwai_files/processing/exceptions.pyfor exactly this kind of non-retryable config/input error), using the same message that was already
being logged via
logger.debug().Testing
Added
lib/crewai-files/tests/test_factory.pywith two regression tests covering both paths.Verified locally:
uv run pytest lib/crewai-files/tests/test_factory.py -v— 2 passeduv run ruff check lib/crewai-files/ --select PLE0704— no issues (confirmed it flagged bothlines on the pre-fix file, and passes after)
uv run mypy lib/crewai-files/src/crewai_files/— no issues found in 33 source filesDisclosure
Found via AI-assisted static analysis (ruff's PLE0704 rule run across the codebase), same
defect pattern as #6430 in a different file. Per CONTRIBUTING.md this needs the
llm-generatedlabel — I can't apply it myself, could a maintainer add it?
🤖 Generated with Claude Code