Better error handling.

This commit is contained in:
Dan Zajdband
2014-07-22 12:22:00 -03:00
parent 142368c0de
commit c1ede365ff

View File

@@ -89,7 +89,6 @@ var execMethod = function(type, params, endpoint, fn){
req.end(function(res){
if(res.ok) fn(null, res.body);
else if(res.body && res.body.status_message) fn(new Error(res.body.status_message), null);
else fn(new Error(res.text), null);
else fn(res.error, null);
});
};