sintaxi / dbox

NodeJS SDK for Dropbox API (THIS LIBRARY IS OBSOLETE!!)
513 stars 91 forks source link

Return `null` instead of `r.statusCode` if an error occurred #15

Closed dannyamey closed 12 years ago

dannyamey commented 12 years ago

If an error occurs connecting to Dropbox the request library will return an error and no response, causing a fatal error when attempting to access the statusCode property. This change will return a null value instead of r.statusCode from dropbox client methods if an error occurs, allowing the calling application to handle the error more gracefully.

A better solution might be to follow the node callback convention by passing the request error object as the first parameter to callbacks, but as that will break every function signature I've left it alone for now.