From a6bcbac233e27652913668ca63c102e4d071d437 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 12 Nov 2019 19:08:18 -0800 Subject: web: catch MacaroonInitException Caught one of these in sentry. Probably due to a crawler? Or typing gibberish in the token form. --- python/fatcat_web/auth.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'python/fatcat_web/auth.py') 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(): -- cgit v1.2.3