Comments (5)
Thank you very much for investing your time in this helpful library - works like a charm in my case.
from spotify-connect-ws.
Thanks for the report and contribution @jfbausch!
Just to be sure, you mean that this error occurs when the user quits the playback app, right?
I'm trying to think about the best way to handle that, and I'm not sure that we should be closing the connection, rather than reporting the failure as an error to the client (it may be useful to let the user know that something's gone wrong).
But you're right that we should absolutely be handling that promise rejection in some way. I'll do some testing later on and we'll get this issue sorted!
from spotify-connect-ws.
Just to be sure, you mean that this error occurs when the user quits the playback app, right?
Yeah, exactly - either by quitting the app, closing the browser tab or login out.
Thanks for the quick response. Hit me up, if I can help you with something.
from spotify-connect-ws.
Hey @jfbausch, thanks again for reporting this issue! I had a look into it and noticed a bunch of ways that the error logic could be improved. To fix the issue you directly mentioned, I have started to check the status code returned by Spotify in the 'getPlayerState' method. It seems to return a 202 when there is no active device (and no JSON, which caused the error), so we can do one better than sending a generic error, and instead detect the issue and let the client know what's gone wrong with a more descriptive message.
This change has been pushed to npm as v0.1.0, please let me know if this resolves the issue for you!
from spotify-connect-ws.
Glad to hear it! Please feel free to report any more issues that you encounter, I'll be happy to help. And send a link over if/when you publish your project!
from spotify-connect-ws.
Related Issues (2)
- No response from server HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spotify-connect-ws.