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

Commit

Permalink
Merge pull request #868 from matrix-org/erikj/invalid_id
Browse files Browse the repository at this point in the history
Make get_domain_from_id throw SynapseError on invalid ID
  • Loading branch information
erikjohnston authored Jun 14, 2016
2 parents e9892b4 + 36e2aad commit d12134c
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 d12134c

Please sign in to comment.