Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Downgrade some OIDC exceptions to warnings (#12723)
Browse files Browse the repository at this point in the history
  • Loading branch information
David Robertson authored May 18, 2022
1 parent a1cb05b commit 6ff99e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/12723.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Downgrade some OIDC errors to warnings in the logs, to reduce the noise of Sentry reports.
4 changes: 2 additions & 2 deletions synapse/handlers/oidc.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ async def handle_oidc_callback(self, request: SynapseRequest) -> None:
self._sso_handler.render_error(request, "invalid_session", str(e))
return
except MacaroonInvalidSignatureException as e:
logger.exception("Could not verify session for OIDC callback")
logger.warning("Could not verify session for OIDC callback: %s", e)
self._sso_handler.render_error(request, "mismatching_session", str(e))
return

Expand Down Expand Up @@ -827,7 +827,7 @@ async def handle_oidc_callback(
logger.debug("Exchanging OAuth2 code for a token")
token = await self._exchange_code(code)
except OidcError as e:
logger.exception("Could not exchange OAuth2 code")
logger.warning("Could not exchange OAuth2 code: %s", e)
self._sso_handler.render_error(request, e.error, e.error_description)
return

Expand Down

0 comments on commit 6ff99e3

Please sign in to comment.