mirror of
https://github.com/element-hq/synapse
synced 2024-09-10 17:45:11 +00:00
Make get_domain_from_id throw SynapseError on invalid ID
This commit is contained in:
parent
16a8884233
commit
36e2aade87
1 changed files with 4 additions and 1 deletions
|
@ -22,7 +22,10 @@ Requester = namedtuple("Requester", ["user", "access_token_id", "is_guest"])
|
|||
|
||||
|
||||
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(
|
||||
|
|
Loading…
Reference in a new issue