clean up AuthError

This commit is contained in:
Neil Johnson 2018-08-15 11:58:03 +01:00
parent c4eb97518f
commit 87a824bad1
1 changed files with 3 additions and 7 deletions

View File

@ -224,13 +224,9 @@ class NotFoundError(SynapseError):
class AuthError(SynapseError): class AuthError(SynapseError):
"""An error raised when there was a problem authorising an event.""" """An error raised when there was a problem authorising an event."""
def __init__(self, *args, **kwargs): def __init__(self, code, msg, errcode=Codes.FORBIDDEN, admin_uri=None):
if "errcode" not in kwargs: self.admin_uri = admin_uri
kwargs["errcode"] = Codes.FORBIDDEN super(AuthError, self).__init__(code, msg, errcode=errcode)
self.admin_uri = kwargs.get('admin_uri')
self.msg = kwargs.get('msg')
self.errcode = kwargs.get('errcode')
super(AuthError, self).__init__(*args, errcode=kwargs["errcode"])
def error_dict(self): def error_dict(self):
return cs_error( return cs_error(