mirror of
https://github.com/KevinMidboe/moviedb.git
synced 2025-10-29 17:50:25 +00:00
Better error handling.
This commit is contained in:
@@ -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);
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user