-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get Player Error Reasons #63
Comments
For reference, this is what I see when interacting with the endpoint through the (API {
"error": {
"status": 404,
"message": "Player command failed: No active device found",
"reason": "NO_ACTIVE_DEVICE"
}
} The
|
Do you mean that the |
I am only guessing here, but I think that @sputnick1124 tried to print the println!("{:#?}", response); Unfortunately, the implementation of the |
@TimotheeGerber is correct. I was naively just printing out the Thanks, @TimotheeGerber! |
PR is open. Please provide any comments/suggestions for improvement. |
Over in
spotify-tui
, I am getting API errors fairly frequently. Much of the time, the error code is 403 (I am able to see that now since #62), which likely means that I am getting a player error, but I get no more information than that.I'm not great at web stuff; I don't understand what is happening to this object in the request response. I figured I would be able to define a struct to hold the player error:
and then (deserialize the json)[https://docs.rs/reqwest/0.10.0-alpha.1/reqwest/struct.Response.html#method.json] from the response directly into it, but
reqwest
seems to be hiding the json from me somehow. What's happening to it? How can I get access to the error reason? This would help immensely in providing more information about failure to both developers and end-users.I'm happy to implement any changes that need to happen, but I don't have much experience handling web requests, and none of that experience is with Rust/
reqwest
, so any other devs here that could shed some light would be appreciated.The text was updated successfully, but these errors were encountered: