Skip to content

Raise rate limit and authentication errors - #869

Open
joostlek wants to merge 1 commit into
mainfrom
ccr-af58c15a-nqvsya-error-status-codes
Open

joostlek wants to merge 1 commit into
mainfrom
ccr-af58c15a-nqvsya-error-status-codes

Conversation

@joostlek

Copy link
Copy Markdown
Owner

Proposed Changes

SpotifyRateLimitError and SpotifyAuthenticationFailedError are exported but never raised, and the rate_limit.json fixture isn't used by any test. A 429 or 401 response was returned as if it were data, then failed in the models with a confusing MissingField error. This is the behaviour #417 reported; the fix from #425 appears to have been lost.

_request now raises:

  • SpotifyAuthenticationFailedError on 401
  • SpotifyRateLimitError on 429
  • SpotifyNotFoundError on a 404 status code, in addition to the existing check for a 404 error body

New tests cover all three; they fail on main and pass with this change.

Related Issues


Generated by Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SLHDn51P7snTSyxtuDToEb
@joostlek joostlek added the bugfix Inconsistencies or issues which will cause a problem for users or implementers. label Oct 30, 2026 — with Claude
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Inconsistencies or issues which will cause a problem for users or implementers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants