spotipy-dev / spotipy

A light weight Python library for the Spotify Web API
http://spotipy.readthedocs.org
MIT License
5.04k stars 959 forks source link

How to retrieve original response body in case of 400 errors. #645

Closed shivam-kapila closed 3 years ago

shivam-kapila commented 3 years ago

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.

Peter-Schorn commented 3 years ago

I just made a pull request that fixed your issue.

shivam-kapila commented 3 years ago

@Peter-Schorn thanks for the action :)

stephanebruckert commented 3 years ago

Released in 2.18.0