Skip to content

Commit

Permalink
Strava uploader: Exit on error to avoid infinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
soutade committed Sep 14, 2023
1 parent c97128a commit 3c185ef
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/stravauploader/strava_uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ def uploadMove(activity):
r = requests.get(activty_url, headers=headers)
resp = r.json()

if resp.get('error', ''):
print(resp['error'])
return (r.status_code, resp['error'])

if r.status_code == 200:
print('New activity at https://www.strava.com/activities/{}'.format(resp['activity_id']))
return (r.status_code, 'OK')
Expand Down

0 comments on commit 3c185ef

Please sign in to comment.