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

Commit

Permalink
Make get_domain_from_id throw SynapseError on invalid ID
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Jun 14, 2016
1 parent 16a8884 commit 36e2aad
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion synapse/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@


def get_domain_from_id(string):
return string.split(":", 1)[1]
try:
return string.split(":", 1)[1]
except IndexError:
raise SynapseError(400, "Invalid ID: %r", string)


class DomainSpecificString(
Expand Down

0 comments on commit 36e2aad

Please sign in to comment.