diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-01-16 15:54:53 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-01-16 15:54:53 -0800 |
commit | 0a8c9a5e07213276617f06b0379a166e7fd1c100 (patch) | |
tree | 374248594bf0d8a5c397fdca8df7385e06f594af | |
parent | 8a0d963beb2fa6766a7141df39dc322abea1b9a0 (diff) | |
download | fatcat-0a8c9a5e07213276617f06b0379a166e7fd1c100.tar.gz fatcat-0a8c9a5e07213276617f06b0379a166e7fd1c100.zip |
more robust IA Xauth logging
-rw-r--r-- | python/fatcat_web/auth.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/python/fatcat_web/auth.py b/python/fatcat_web/auth.py index 8035cbe5..03964c92 100644 --- a/python/fatcat_web/auth.py +++ b/python/fatcat_web/auth.py @@ -90,7 +90,10 @@ def handle_ia_xauth(email, password): 'secret': Config.IA_XAUTH_CLIENT_SECRET, }) if resp.status_code == 401 or (not resp.json().get('success')): - flash("Internet Archive email/password didn't match: {}".format(resp.json()['values']['reason'])) + try: + flash("Internet Archive email/password didn't match: {}".format(resp.json()['values']['reason'])) + except: + print("IA XAuth fail: {}".format(resp.content)) return render_template('auth_ia_login.html', email=email), resp.status_code elif resp.status_code != 200: flash("Internet Archive login failed (internal error?)") |