Feature: Add __str__ to OAuthRefreshException#107
Conversation
WalkthroughThe ChangesOAuth Error Message Formatting
Possibly related PRs
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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.
Pull request overview
Adds a __str__ method to OAuthRefreshException so stringifying the exception produces a more descriptive message that includes the error and error_description fields from the OAuth response when available, falling back to the inherited message.
Changes:
- Implement
__str__onOAuthRefreshExceptionwith three formatting branches (both fields, error only, message only).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
18149c1 to
3aeaedf
Compare
| def __str__(self): | ||
| if self.error and self.error_description: | ||
| return f'{self.message}: {self.error} - {self.error_description}' | ||
|
|
||
| if self.error: | ||
| return f'{self.message}: {self.error}' | ||
|
|
||
| return self.message |
Extracted from #104
Adds a
__str__method toOAuthRefreshExceptionso stringifying the exception produces a more descriptive message that includes the error and error_description fields from the OAuth response when available, falling back to the inherited message.Changes:
__str__onOAuthRefreshExceptionwith three formatting branches (both fields, error only, message only).