Skip to content

Commit

Permalink
make sure to catch async errors, too
Browse files Browse the repository at this point in the history
  • Loading branch information
minrk committed Aug 29, 2024
1 parent ae48b33 commit 010c288
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions oauthenticator/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1184,12 +1184,12 @@ async def _call_modify_auth_state_hook(self, auth_state):
"""Call the modify_auth_state_hook"""
try:
auth_state = self.modify_auth_state_hook(self, auth_state)
if isawaitable(auth_state):
auth_state = await auth_state
except Exception as e:
# let hook errors raise, nothing in auth should suppress errors
self.log.error(f"Error in modify_auth_state_hook: {e}")
raise
if isawaitable(auth_state):
auth_state = await auth_state
return auth_state

async def authenticate(self, handler, data=None, **kwargs):
Expand Down

0 comments on commit 010c288

Please sign in to comment.