Skip to content

Commit

Permalink
Fix Rollbar error reporting
Browse files Browse the repository at this point in the history
Previously we assumed that the error would have a message
attribute. This is not always the case. Now we only access
that when it is available.
  • Loading branch information
rajadain committed Feb 23, 2022
1 parent 83ceca0 commit f5f990c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/mmw/apps/user/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,11 @@ def concord_auth(request):
concord_user = session.get_user()
except Exception as e:
# Report OAuth error
rollbar.report_message(f'Concord OAuth Error: {e.message}', 'error')
message = 'Concord OAuth Error'
if hasattr(e, 'message'):
message += f': {e.message}'

rollbar.report_message(message, 'error')
return redirect('/error/sso')

user = authenticate(sso_id=concord_user['id'])
Expand Down

0 comments on commit f5f990c

Please sign in to comment.