[GH-ISSUE #645] How to retrieve original response body in case of 400 errors. #387

Closed
opened 2026-02-27 23:22:20 +03:00 by kerem · 3 comments
Owner

Originally created by @shivam-kapila on GitHub (Feb 25, 2021).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/645

Is there a way to retrieve the original response body in case of 400 errors. e.g. The error message in case of error #503 is

{
    "error": "invalid_grant",
    "error_description": "Refresh token revoked"
}

But spotipy only shows 400 Bad Request and not the original message Refresh token revoked. A way to access the original JSON would help better debug issues in client apps.

Originally created by @shivam-kapila on GitHub (Feb 25, 2021). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/645 Is there a way to retrieve the original response body in case of 400 errors. e.g. The error message in case of error #503 is ``` { "error": "invalid_grant", "error_description": "Refresh token revoked" } ``` But spotipy only shows 400 Bad Request and not the original message `Refresh token revoked.` A way to access the original JSON would help better debug issues in client apps.
kerem 2026-02-27 23:22:20 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@Peter-Schorn commented on GitHub (Mar 12, 2021):

I just made a pull request that fixed your issue.

<!-- gh-comment-id:797446871 --> @Peter-Schorn commented on GitHub (Mar 12, 2021): I just made a pull request that fixed your issue.
Author
Owner

@shivam-kapila commented on GitHub (Mar 12, 2021):

@Peter-Schorn thanks for the action :)

<!-- gh-comment-id:797643562 --> @shivam-kapila commented on GitHub (Mar 12, 2021): @Peter-Schorn thanks for the action :)
Author
Owner

@stephanebruckert commented on GitHub (Jun 26, 2021):

Released in 2.18.0

<!-- gh-comment-id:869060030 --> @stephanebruckert commented on GitHub (Jun 26, 2021): Released in 2.18.0
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#387
No description provided.