Merge pull request #16 from spacepluk/master

get more meaningful errors
This commit is contained in:
Dan Zajdband
2014-07-08 18:11:54 -03:00

View File

@@ -38,7 +38,7 @@ MovieDB.prototype.requestToken = function(fn){
.set('Accept', 'application/json')
.end(function(res){
if(res.ok) self.token = res.body;
else throw new Error('Invalid authentication');
else throw res.error;
fn();
});