Browse Source

Fixed error with promise error rejection.

pull/11/head
Jeffery Russell 5 years ago
parent
commit
648625128f
2 changed files with 7 additions and 3 deletions
  1. +3
    -1
      public/js/friendsGraph.js
  2. +4
    -2
      routes/api.js

+ 3
- 1
public/js/friendsGraph.js View File

@ -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()

+ 4
- 2
routes/api.js View File

@ -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);
});
}

Loading…
Cancel
Save