spotify / web-api

This issue tracker is no longer used. Join us in the Spotify for Developers forum for support with the Spotify Web API ➡️ https://community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer
981 stars 79 forks source link

Clearer error when no devices are connected with the currently-playing endpoint #772

Open mikhailusov opened 6 years ago

mikhailusov commented 6 years ago

Issue found on January 30th 2018.

Endpoint(s):

Scope(s):

Steps to reproduce:

Not sure, usually happens when I try to call endpoint after not playing for a long time (~ couple of hours?). Or when no devices is available. Tho I am trying to access it while I am running Spotify.

  1. Open the API Console
  2. Call the currently-playing endpoint with your user after not playing anything in Spotify player for a long time.

Expected behaviour:

200 OK with no data populated, as described on https://beta.developer.spotify.com/documentation/web-api/reference/player/get-the-users-currently-playing-track/.

Actual behaviour:

404 Error (when no device is available or haven't played in a long time) with response body:

{
  "error" : {
    "status" : 404,
    "message" : "non existing id"
  }
}
bih commented 6 years ago

Thanks for the report @mikhailusov! We're investigating this and will report here with updates.

bih commented 6 years ago

Just an update:

The Web API returns the following error message because no devices are connected. After a certain period of time, your main Spotify device (i.e. the desktop app, or mobile app) will also disconnect, which will return this response.

However, I'll leave this ticket open as a feature request for improving the error message. In this case, we agree it is unclear. Once this has been fixed, we'll close the ticket.

mikhailusov commented 6 years ago

Thanks @bih! Also hope documentation will be updated as well.