aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-11-12 19:08:18 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-11-12 19:08:20 -0800
commita6bcbac233e27652913668ca63c102e4d071d437 (patch)
treea15ea438696f5c60a7ed3d4dba5c23016beeddb8
parentd1cb7551e2cee506c51666d79a4a977e86bb23b3 (diff)
downloadfatcat-a6bcbac233e27652913668ca63c102e4d071d437.tar.gz
fatcat-a6bcbac233e27652913668ca63c102e4d071d437.zip
web: catch MacaroonInitException
Caught one of these in sentry. Probably due to a crawler? Or typing gibberish in the token form.
-rw-r--r--python/fatcat_web/auth.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/python/fatcat_web/auth.py b/python/fatcat_web/auth.py
index 5c8507c1..8e26b7fe 100644
--- a/python/fatcat_web/auth.py
+++ b/python/fatcat_web/auth.py
@@ -22,6 +22,10 @@ def handle_token_login(token):
# TODO: what kind of Exceptions?
app.log.warning("auth fail: MacaroonDeserializationException")
return abort(400)
+ except pymacaroons.exceptions.MacaroonInitException:
+ # TODO: what kind of Exceptions?
+ app.log.warning("auth fail: must supply a valid token")
+ return abort(400)
# extract editor_id
editor_id = None
for caveat in m.first_party_caveats():