Skip to content

Commit

Permalink
refactor: send sentry notification if any exception occurs during /token
Browse files Browse the repository at this point in the history
  • Loading branch information
angela-tran committed May 21, 2024
1 parent 2953bb6 commit 3769a00
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion benefits/enrollment/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ def token(request):
try:
response = client.request_card_tokenization_access()
except Exception as e:
sentry_sdk.capture_exception(e)

if isinstance(e, HTTPError) and e.response.status_code >= 500:
analytics.failed_access_token_request(request, e.response.status_code)
sentry_sdk.capture_exception(e)
data = {"redirect": reverse(ROUTE_SYSTEM_ERROR)}
return JsonResponse(data)
else:
Expand Down

0 comments on commit 3769a00

Please sign in to comment.