From 648625128fde396475b1352eff1196a4e15e4661 Mon Sep 17 00:00:00 2001 From: jrtechs Date: Sat, 16 Feb 2019 20:48:50 -0500 Subject: [PATCH] Fixed error with promise error rejection. --- public/js/friendsGraph.js | 4 +++- routes/api.js | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/public/js/friendsGraph.js b/public/js/friendsGraph.js index 8875055..b41c876 100644 --- a/public/js/friendsGraph.js +++ b/public/js/friendsGraph.js @@ -193,7 +193,8 @@ function createConnections() resolve(); }).catch(function(error) { - reject(error); + console.log(error); + resolve(); }); }); } @@ -246,6 +247,7 @@ function createFriendsGraph(username, containerName, graphsTitle) edges = []; addSelfToGraph(username).then(function() { + console.log("added self"); addFriends(username, API_FOLLOWERS).then(function() { addFriends(username, API_FOLLOWING).then(function() diff --git a/routes/api.js b/routes/api.js index 418652c..ab26aea 100644 --- a/routes/api.js +++ b/routes/api.js @@ -33,8 +33,10 @@ function queryGitHubAPI(requestURL) cache.put(requestURL, response.body); }).catch(error => { - resolve(response.body); - cache.put(requestURL, response.body); + // resolve(response.body); + // cache.put(requestURL, response.body); + console.log(error); + reject(error); }); }