summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-11-26 16:06:20 +0000
committerErik Johnston <erik@matrix.org>2014-11-26 16:06:20 +0000
commit6c485c282dced1e60c0702ae8e9278fcc6a4f54c (patch)
treeba3a43e719209fabc79294e5bb89754e5b8d324e
parentSpelling (diff)
downloadsynapse-6c485c282dced1e60c0702ae8e9278fcc6a4f54c.tar.xz
Catch exceptions when trying to add an entry to rooms tables
-rw-r--r--synapse/handlers/federation.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index 252c1f1684..5c6ed28e62 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -18,7 +18,9 @@
 from ._base import BaseHandler
 
 from synapse.api.events.utils import prune_event
-from synapse.api.errors import AuthError, FederationError, SynapseError
+from synapse.api.errors import (
+    AuthError, FederationError, SynapseError, StoreError,
+)
 from synapse.api.events.room import RoomMemberEvent
 from synapse.api.constants import Membership
 from synapse.util.logutils import log_function
@@ -174,11 +176,14 @@ class FederationHandler(BaseHandler):
         room = yield self.store.get_room(event.room_id)
 
         if not room:
-            yield self.store.store_room(
-                room_id=event.room_id,
-                room_creator_user_id="",
-                is_public=False,
-            )
+            try:
+                yield self.store.store_room(
+                    room_id=event.room_id,
+                    room_creator_user_id="",
+                    is_public=False,
+                )
+            except StoreError:
+                logger.exception("Failed to store room.")
 
         if not backfilled:
             extra_users = []