summaryrefslogtreecommitdiff
path: root/synapse/api
diff options
context:
space:
mode:
authorErik Johnston <erikj@matrix.org>2017-05-18 13:58:28 +0100
committerErik Johnston <erikj@matrix.org>2017-05-18 13:58:28 +0100
commitc7128061a0fe2a78d344c3f6f9700bc687ef003d (patch)
tree5bfad3c1e8653713f8e14062732f892797279a92 /synapse/api
parent6396247906b041b8a88e7de17808b2a5ca5e9064 (diff)
Imported Upstream version 0.21.0
Diffstat (limited to 'synapse/api')
-rw-r--r--synapse/api/errors.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/synapse/api/errors.py b/synapse/api/errors.py
index 6fbd5d68..d0dfa959 100644
--- a/synapse/api/errors.py
+++ b/synapse/api/errors.py
@@ -66,6 +66,17 @@ class CodeMessageException(RuntimeError):
return cs_error(self.msg)
+class MatrixCodeMessageException(CodeMessageException):
+ """An error from a general matrix endpoint, eg. from a proxied Matrix API call.
+
+ Attributes:
+ errcode (str): Matrix error code e.g 'M_FORBIDDEN'
+ """
+ def __init__(self, code, msg, errcode=Codes.UNKNOWN):
+ super(MatrixCodeMessageException, self).__init__(code, msg)
+ self.errcode = errcode
+
+
class SynapseError(CodeMessageException):
"""A base exception type for matrix errors which have an errcode and error
message (as well as an HTTP status code).