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.
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 anull
value instead ofr.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.