Throw error on bad apikey request.

This commit is contained in:
Dan Zajdband
2014-10-15 20:16:10 -03:00
parent cfdb406cd3
commit 2e093aa080

View File

@@ -40,8 +40,8 @@ MovieDB.prototype.requestToken = function(fn){
if(res.ok) self.token = res.body; if(res.ok) self.token = res.body;
else throw res.error; else throw res.error;
fn(); fn();
}).on('error', function(){ }).on('error', function(error){
throw res.error; throw error;
}); });
return this; return this;