Merge pull request #868 from matrix-org/erikj/invalid_id

Make get_domain_from_id throw SynapseError on invalid ID
This commit is contained in:
Erik Johnston 2016-06-14 15:09:07 +01:00 committed by GitHub
commit d12134ce37
1 changed files with 4 additions and 1 deletions

View File

@ -22,7 +22,10 @@ Requester = namedtuple("Requester", ["user", "access_token_id", "is_guest"])
def get_domain_from_id(string):
try:
return string.split(":", 1)[1]
except IndexError:
raise SynapseError(400, "Invalid ID: %r", string)
class DomainSpecificString(