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

Commit

Permalink
Convert an unknown session into a SynapseError.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Apr 17, 2020
1 parent b2eaa4b commit 6fa823c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion synapse/handlers/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,10 @@ def _get_session_info(self, session_id: str) -> dict:
The session can be used to track data across multiple requests, e.g. for
interactive authentication.
"""
return self.sessions[session_id]
try:
return self.sessions[session_id]
except KeyError:
raise SynapseError(400, "Unknown session ID: %s" % session_id)

async def get_access_token_for_user_id(
self, user_id: str, device_id: Optional[str], valid_until_ms: Optional[int]
Expand Down

0 comments on commit 6fa823c

Please sign in to comment.