syncstorage-rs
syncstorage-rs copied to clipboard
Exceptions from Tokenserver's verify.py should emit Sentry events
During a recent FxA outage there were exceptions raised by the Python verify code that would show up in logs, but not sentry, e.g.
fxa.errors.OutOfProtocolError: API responded with non-json content-type: text/html
raise fxa.errors.OutOfProtocolError(msg.format(content_type))
File "/usr/local/lib/python3.11/dist-packages/fxa/_utils.py", line 273, in request
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return self.request("POST", url, json, **kwds)
File "/usr/local/lib/python3.11/dist-packages/fxa/_utils.py", line 341, in post
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
resp = self.apiclient.post('/verify', {'token': token})
Traceback (most recent call last):
File "verify.py", line 14, in verify_token
File "/usr/local/lib/python3.11/dist-packages/fxa/oauth.py", line 280, in verify_token
(pulled from BigQuery so it might be a bit jumbled).
For ease of diagnosing issues, such errors (those not explicitly caught in verify.py) should also be logged as Sentry events.
┆Issue is synchronized with this Jira Task