mirror of
https://github.com/KevinMidboe/moviedb.git
synced 2025-10-29 17:50:25 +00:00
get more meaningful errors
This commit is contained in:
@@ -38,7 +38,7 @@ MovieDB.prototype.requestToken = function(fn){
|
|||||||
.set('Accept', 'application/json')
|
.set('Accept', 'application/json')
|
||||||
.end(function(res){
|
.end(function(res){
|
||||||
if(res.ok) self.token = res.body;
|
if(res.ok) self.token = res.body;
|
||||||
else throw new Error('Invalid authentication');
|
else throw res.error;
|
||||||
fn();
|
fn();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user