mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 21:04:50 -04:00
Oops: second part of commit dc938606
This commit is contained in:
parent
dc93860619
commit
ede491b4e0
6 changed files with 45 additions and 7 deletions
|
@ -21,6 +21,7 @@ logger = logging.getLogger(__name__)
|
|||
|
||||
|
||||
class Codes(object):
|
||||
UNRECOGNIZED = "M_UNRECOGNIZED"
|
||||
UNAUTHORIZED = "M_UNAUTHORIZED"
|
||||
FORBIDDEN = "M_FORBIDDEN"
|
||||
BAD_JSON = "M_BAD_JSON"
|
||||
|
@ -82,6 +83,17 @@ class RegistrationError(SynapseError):
|
|||
pass
|
||||
|
||||
|
||||
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
|
||||
super(UnrecognizedRequestError, self).__init__(
|
||||
400,
|
||||
"Unrecognized request",
|
||||
**kwargs
|
||||
)
|
||||
|
||||
class AuthError(SynapseError):
|
||||
"""An error raised when there was a problem authorising an event."""
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue