Skip to content

Commit

Permalink
Print status_code and headers on login failure
Browse files Browse the repository at this point in the history
  • Loading branch information
davewongillies committed Feb 24, 2021
1 parent 5378af0 commit 40fced2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion garmin_uploader/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def authenticate(self, username, password):
# Check login
res = session.get(URL_PROFILE)
if not res.ok:
raise Exception("Login check failed.")
raise Exception("{} Login check failed: {}".format(res.status_code, res.headers))
garmin_user = res.json()
logger.info('Logged in as {}'.format(garmin_user['fullName']))

Expand Down

0 comments on commit 40fced2

Please sign in to comment.