diff options
| author | Bryan Newbold <bnewbold@robocracy.org> | 2019-11-12 19:08:18 -0800 | 
|---|---|---|
| committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-11-12 19:08:20 -0800 | 
| commit | a6bcbac233e27652913668ca63c102e4d071d437 (patch) | |
| tree | a15ea438696f5c60a7ed3d4dba5c23016beeddb8 | |
| parent | d1cb7551e2cee506c51666d79a4a977e86bb23b3 (diff) | |
| download | fatcat-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.py | 4 | 
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(): | 
