Exception thrown when Dropbox is down #56

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

Comments

Projects
None yet
2 participants
@scttnlsn

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

This comment has been minimized.

Show comment Hide comment
@scttnlsn

scttnlsn Oct 31, 2012

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

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

@jeremycondon

This comment has been minimized.

Show comment Hide comment
@jeremycondon

jeremycondon Oct 31, 2012

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

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