Skip to content
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

TypeError: Cannot read property 'csrftoken' of undefined #52

Open
LinusU opened this issue Sep 19, 2013 · 1 comment
Open

TypeError: Cannot read property 'csrftoken' of undefined #52

LinusU opened this issue Sep 19, 2013 · 1 comment

Comments

@LinusU
Copy link
Contributor

LinusU commented Sep 19, 2013

Seems related to #51, this one also just happened one time. It would be nice if we could catch both and either return the err to the login callback, or just try again.

I will try to whip up a pull request if I have time.

TypeError: Cannot read property 'csrftoken' of undefined
    at Spotify._onsecret (node_modules/spotify-web/lib/spotify.js:265:54)
    at Request.callback (node_modules/spotify-web/node_modules/superagent/lib/node/index.js:584:30)
    at Request.<anonymous> (node_modules/spotify-web/node_modules/superagent/lib/node/index.js:133:10)
    at Request.EventEmitter.emit (events.js:117:20)
    at IncomingMessage.<anonymous> (node_modules/spotify-web/node_modules/superagent/lib/node/index.js:714:12)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:920:16
    at process._tickCallback (node.js:415:13)
@Shigawire
Copy link

Hey, tracked that down to the _onsecret method.

Spotify.prototype._onsecret = function (err, res) {
  if (err) return this.emit('error', err);
  if(res.error) return this.emit('error', res.error);

will at least fail more gracefully than throwing. For me, it returns a 504 - Gateway timeout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants