As yet fairly untested GET API for push rules

This commit is contained in:
David Baker 2015-01-22 19:32:17 +00:00
parent 673773b217
commit 8a850573c9
3 changed files with 145 additions and 15 deletions

View file

@ -87,13 +87,25 @@ class UnrecognizedRequestError(SynapseError):
"""An error indicating we don't understand the request you're trying to make"""
def __init__(self, *args, **kwargs):
if "errcode" not in kwargs:
kwargs["errcode"] = Codes.NOT_FOUND
kwargs["errcode"] = Codes.UNRECOGNIZED
super(UnrecognizedRequestError, self).__init__(
400,
"Unrecognized request",
**kwargs
)
class NotFoundError(SynapseError):
"""An error indicating we can't find the thing you asked for"""
def __init__(self, *args, **kwargs):
if "errcode" not in kwargs:
kwargs["errcode"] = Codes.NOT_FOUND
super(UnrecognizedRequestError, self).__init__(
404,
"Not found",
**kwargs
)
class AuthError(SynapseError):
"""An error raised when there was a problem authorising an event."""