Skip to content

Commit

Permalink
Merge pull request #266 from capcodigital/feature/fitbit-issues
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewkentish committed Jul 1, 2024
2 parents 582b76e + 7103488 commit 90ce6f7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/controllers/strava.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,11 @@ function getStats(user) {
var integerTime = ((new Date(challengeDates[0])).getTime())/1000;
strava.athlete.listActivities({ 'access_token':user.access_token, after: integerTime, per_page: 100 }, function(err, result) {
if (err) {
let errorText = err.errors ? JSON.stringify(err.errors) : JSON.stringify(err);
if (err.toString().includes("Authorization Error")){
console.log("User authentication error with Strava for " + user.name + " - " + err.errors.toString());
console.log("User authentication error with Strava for " + user.name + " - " + errorText);
} else {
console.log("Error Accessing Strava activities for " + user.name + " - " + err.errors.toString());
console.log("Error Accessing Strava activities for " + user.name + " - " + errorText);
}
} else {
console.log("Updating Strava Stats for: " + user.name);
Expand Down

0 comments on commit 90ce6f7

Please sign in to comment.