From 420680e74093ed2a2469fc02c8a09f5855d6f4df Mon Sep 17 00:00:00 2001 From: Brian Simpson Date: Fri, 6 May 2016 12:05:21 -0700 Subject: [PATCH] OAuth2AccessToken: Log attributes when an invalid token is found This will help diagnose why these invalid tokens exist. --- r2/r2/models/token.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/r2/r2/models/token.py b/r2/r2/models/token.py index 218e6476c..3eb7482f6 100644 --- a/r2/r2/models/token.py +++ b/r2/r2/models/token.py @@ -643,6 +643,9 @@ class OAuth2AccessToken(Token): client = OAuth2Client._byID(self.client_id) if getattr(client, 'deleted', False): raise NotFound + except AttributeError: + g.log.error("bad token %s: %s", self, self._t) + raise except NotFound: return False