-
Notifications
You must be signed in to change notification settings - Fork 27
fix: fallback to type name in from_exception when exception has no message
#650
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
Conversation
WalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
ably/util/exceptions.py (1)
76-87:from_exceptionenhancement looks correct; consider optionally wiringcauseThe new construction of
exc_type/exc_msgand fallback to the exception type name when the message is empty cleanly solves the “Unexpected exception:” blank-message issue and also improves context by including the type when a message exists. The behavior for existingAblyExceptioninstances remains unchanged, and status/code semantics are preserved.As a minor optional improvement, you could also pass the original exception as
causewhen constructing theAblyException(in addition toraise ... from e), so callers that inspectAblyException.causeget structured access to the wrapped exception:- return AblyException(f"Unexpected exception: {message}", 500, 50000) + return AblyException( + f"Unexpected exception: {message}", + 500, + 50000, + cause=e, + )
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
ably/util/exceptions.py(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: check (3.12)
- GitHub Check: check (3.8)
- GitHub Check: check (3.13)
- GitHub Check: check (3.9)
- GitHub Check: check (3.11)
- GitHub Check: check (3.10)
- GitHub Check: check (3.7)
ttypic
left a comment
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.
LGTM
httpx errors for example have no message so a http open timeout in
rest.time()would result in an error message of "Unexpected exception:"Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.