diff options
author | Erik Johnston <erik@matrix.org> | 2015-02-05 13:17:05 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-02-05 13:17:05 +0000 |
commit | 26a041541baed887dc069c3667a86ddef81802bc (patch) | |
tree | e358634eb02cc7eeb0ce8e262448b348a0aa71f2 /synapse/handlers | |
parent | Print out the auth events on failure (diff) | |
download | synapse-26a041541baed887dc069c3667a86ddef81802bc.tar.xz |
SYN-202: Log as WARN the 404 'Presence information not visible' errors instead of as ERROR since they were spamming the logs
Diffstat (limited to 'synapse/handlers')
-rw-r--r-- | synapse/handlers/message.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py index 6fbd2af4ab..3f51f38f18 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py @@ -16,7 +16,7 @@ from twisted.internet import defer from synapse.api.constants import EventTypes, Membership -from synapse.api.errors import RoomError +from synapse.api.errors import RoomError, SynapseError from synapse.streams.config import PaginationConfig from synapse.events.utils import serialize_event from synapse.events.validator import EventValidator @@ -372,10 +372,17 @@ class MessageHandler(BaseHandler): as_event=True, ) presence.append(member_presence) - except Exception: - logger.exception( - "Failed to get member presence of %r", m.user_id - ) + except SynapseError as e: + if e.code == 404: + # FIXME: We are doing this as a warn since this gets hit a + # lot and spams the logs. Why is this happening? + logger.warn( + "Failed to get member presence of %r", m.user_id + ) + else: + logger.exception( + "Failed to get member presence of %r", m.user_id + ) time_now = self.clock.time_msec() |