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

Exception thrown when Dropbox is down #56

Open
scttnlsn opened this issue Oct 31, 2012 · 2 comments
Open

Exception thrown when Dropbox is down #56

scttnlsn opened this issue Oct 31, 2012 · 2 comments

Comments

@scttnlsn
Copy link

Got a JSON parse error thrown when making a call to the files_put endpoint while the Dropbox service was down:

SyntaxError: Unexpected token <
    at Object.parse (native)
    at Request.exports.app.client.put [as _callback] (./node_modules/dbox/dbox.js:142:57)
    at Request.init.self.callback (./node_modules/dbox/node_modules/request/main.js:119:22)
    at Request.<anonymous> (./node_modules/dbox/node_modules/request/main.js:525:16)
    at Request.EventEmitter.emit (events.js:88:17)
    at IncomingMessage.Request.start.self.req.self.httpModule.request.buffer (./node_modules/dbox/node_modules/request/main.js:484:14)
    at IncomingMessage.EventEmitter.emit (events.js:115:20)
    at IncomingMessage._emitEnd (http.js:366:10)
    at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:149:23)
    at CleartextStream.socketOnData [as ondata] (http.js:1366:20)

Perhaps if the response has status code >= 500 the function should return an error to the callback?

@scttnlsn
Copy link
Author

Nevermind, looks like errors are never returned. It shouldn't proceed to parse the body though.

@jeremycondon
Copy link

Issue 57 should resolve this. I must have done the pull request wrong.

andrewrk added a commit to andrewrk/node-dbox that referenced this issue Nov 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants