Skip to content

Commit

Permalink
Example error handling fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdiego committed Feb 9, 2018
1 parent 7daf379 commit 9bda272
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion example.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ app.get("/callback", (req, res) => {
// use the access token to fetch the user's profile information
client.get("/profile.json", result.access_token).then(results => {
res.send(results[0]);
}).catch(err => {
res.status(err.status).send(err);
});
}).catch(res.send);
}).catch(err => {
res.status(err.status).send(err);
});
});

// launch the server
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fitbit-node",
"version": "2.1.0",
"version": "2.1.0+001",
"description": "An API client library for Fitbit written in Node.js.",
"main": "fitbit-api-client.js",
"scripts": {
Expand Down

0 comments on commit 9bda272

Please sign in to comment.