I sometimes get errors in my app which appear to be caused by TCP-level disconnects or server errors from the Dropbox API server. In such cases, it looks like request does not provide a response object in the callback, but the error object is also null, so the dbox code looks for response.statusCode even though response is undefined.
2012-05-15T12:16:51+00:00 app[web.1]: TypeError: Cannot read property 'statusCode' of undefined
2012-05-15T12:16:51+00:00 app[web.1]: at Request._callback (/app/node_modules/dbox/dbox.js:134:42)
2012-05-15T12:16:51+00:00 app[web.1]: at Request.callback (/app/node_modules/dbox/node_modules/request/main.js:119:22)
2012-05-15T12:16:51+00:00 app[web.1]: at Request.<anonymous> (/app/node_modules/dbox/node_modules/request/main.js:212:58)
2012-05-15T12:16:51+00:00 app[web.1]: at ClientRequest.<anonymous> (/app/node_modules/dbox/node_modules/request/main.js:209:10)
2012-05-15T12:16:51+00:00 app[web.1]: at Request.emit (events.js:67:17)
2012-05-15T12:16:51+00:00 app[web.1]: at CleartextStream.<anonymous> (http.js:1163:11)
2012-05-15T12:16:51+00:00 app[web.1]: at ClientRequest.emit (events.js:67:17)
2012-05-15T12:16:51+00:00 app[web.1]: at CleartextStream.emit (events.js:67:17)
2012-05-15T12:16:51+00:00 app[web.1]: at Socket.emit (events.js:88:20)
2012-05-15T12:16:51+00:00 app[web.1]: at Socket.onerror (tls.js:1144:17)
I sometimes get errors in my app which appear to be caused by TCP-level disconnects or server errors from the Dropbox API server. In such cases, it looks like request does not provide a response object in the callback, but the error object is also null, so the dbox code looks for
response.statusCode
even thoughresponse
is undefined.