diff options
author | David Baker <dbkr@matrix.org> | 2014-11-20 17:49:48 +0000 |
---|---|---|
committer | David Baker <dbkr@matrix.org> | 2014-11-20 17:49:48 +0000 |
commit | f1c7f8e8131d6e5531e23e3bc2cd57ab7d1881ae (patch) | |
tree | b1ebd402c0805f475500c9f36a0356322bf26f13 /synapse/api/errors.py | |
parent | Separate out the matrix http client completely because just about all of its ... (diff) | |
parent | Fix pep8 codestyle warnings (diff) | |
download | synapse-f1c7f8e8131d6e5531e23e3bc2cd57ab7d1881ae.tar.xz |
Merge branch 'develop' into http_client_refactor
Diffstat (limited to 'synapse/api/errors.py')
-rw-r--r-- | synapse/api/errors.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/synapse/api/errors.py b/synapse/api/errors.py index 33d15072af..581439ceb3 100644 --- a/synapse/api/errors.py +++ b/synapse/api/errors.py @@ -17,6 +17,8 @@ import logging +logger = logging.getLogger(__name__) + class Codes(object): UNAUTHORIZED = "M_UNAUTHORIZED" @@ -38,7 +40,7 @@ class CodeMessageException(Exception): """An exception with integer code and message string attributes.""" def __init__(self, code, msg): - logging.error("%s: %s, %s", type(self).__name__, code, msg) + logger.info("%s: %s, %s", type(self).__name__, code, msg) super(CodeMessageException, self).__init__("%d: %s" % (code, msg)) self.code = code self.msg = msg @@ -140,7 +142,8 @@ def cs_exception(exception): if isinstance(exception, CodeMessageException): return exception.error_dict() else: - logging.error("Unknown exception type: %s", type(exception)) + logger.error("Unknown exception type: %s", type(exception)) + return {} def cs_error(msg, code=Codes.UNKNOWN, **kwargs): |