Skip to content

Feature: Add message to OAuthRefreshException#106

Merged
glensc merged 1 commit into
mainfrom
OAuthRefreshException-message
May 28, 2026
Merged

Feature: Add message to OAuthRefreshException#106
glensc merged 1 commit into
mainfrom
OAuthRefreshException-message

Conversation

@glensc
Copy link
Copy Markdown
Owner

@glensc glensc commented May 28, 2026

This sets own message rather inheriting from OAuthException

Extracted from #104

@glensc glensc self-assigned this May 28, 2026
@glensc glensc requested a review from Copilot May 28, 2026 16:10
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Review Change Stack

Walkthrough

OAuthRefreshException now explicitly defines a class-level message attribute with the text "Unauthorized - OAuth token refresh failed" instead of relying on inherited messaging from OAuthException.

OAuth Error Messages

Layer / File(s) Summary
OAuthRefreshException error message
trakt/errors.py
Exception class now defines a specific class-level message attribute for OAuth token refresh failures.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A message so clear, now defined with care,
When tokens refresh and tokens despair,
The exception declares what went wrong that day—
"Your OAuth has failed, do refresh, I say!"

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a message attribute to the OAuthRefreshException class.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The description clearly explains that the PR sets a specific message for OAuthRefreshException rather than inheriting from OAuthException, which aligns with the changeset shown in the raw_summary.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch OAuthRefreshException-message

Warning

Review ran into problems

🔥 Problems

Stopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a @coderabbit review after the pipeline has finished.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates OAuthRefreshException to provide a more specific human-readable message when OAuth token refresh fails.

Changes:

  • Add a dedicated message string to OAuthRefreshException for clearer error reporting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread trakt/errors.py
Comment on lines +72 to 76
message = 'Unauthorized - OAuth token refresh failed'

def __init__(self, response=None):
super().__init__(response)
self.data = self.response.json()
Comment thread trakt/errors.py
Comment on lines +72 to 75
message = 'Unauthorized - OAuth token refresh failed'

def __init__(self, response=None):
super().__init__(response)
Comment thread trakt/errors.py
Comment on lines +72 to +73
message = 'Unauthorized - OAuth token refresh failed'

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Actionable comments posted: 0

@glensc glensc merged commit fe8548c into main May 28, 2026
9 checks passed
@glensc glensc deleted the OAuthRefreshException-message branch May 28, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants