From ba1ad544f9e67db5fdec737dd10ae36e4814b9ca Mon Sep 17 00:00:00 2001 From: Dan Date: Sun, 27 Jul 2014 12:10:58 -0300 Subject: [PATCH] Release 0.1.7 --- History.md | 8 ++++++++ lib/moviedb.js | 4 ++++ package.json | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/History.md b/History.md index f309ed2..3009a6e 100644 --- a/History.md +++ b/History.md @@ -1,3 +1,11 @@ +0.1.7 / 2014-07-27 +================== + + * Added Multi endpoint + * Error handling + * Movie credits endpoint + + 0.1.6 / 2014-07-08 ================== diff --git a/lib/moviedb.js b/lib/moviedb.js index 35e74ba..627f242 100644 --- a/lib/moviedb.js +++ b/lib/moviedb.js @@ -40,6 +40,8 @@ MovieDB.prototype.requestToken = function(fn){ if(res.ok) self.token = res.body; else throw res.error; fn(); + }).on('error', function(){ + throw res.error; }); return this; @@ -91,4 +93,6 @@ var execMethod = function(type, params, endpoint, fn){ if(res.ok) fn(null, res.body); else fn(res.error, null); }); + + req.on('error', fn); }; diff --git a/package.json b/package.json index 7125cb9..cc0a630 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name" : "moviedb" , "description" : "Library for interacting with themoviedb.com API" - , "version" : "0.1.6" + , "version" : "0.1.7" , "keywords" : ["themoviedb","api"] , "directories" : { "lib" : "./lib" } , "main" : "index.js"