sintaxi / dbox

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

Fixed dbox crash issues in callbacks when errors are returned from server #42

Closed jeremycondon closed 12 years ago

jeremycondon commented 12 years ago

The callbacks when errors are encountered attempt to parse the output on each of the verbs. Changes is as follows cb(e ? null : r.statusCode, JSON.parse(b)) cb(e ? null : r.statusCode, e ? null : JSON.parse(b))

jeremycondon commented 12 years ago

It may be more correct to wrap a try/catch around the JSON.parse in case the response from the server is not valid