Catch exceptions when trying to add an entry to rooms tables

This commit is contained in:
Erik Johnston 2014-11-26 16:06:20 +00:00
parent 4bae6851d1
commit 6c485c282d

View File

@ -18,7 +18,9 @@
from ._base import BaseHandler from ._base import BaseHandler
from synapse.api.events.utils import prune_event 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.events.room import RoomMemberEvent
from synapse.api.constants import Membership from synapse.api.constants import Membership
from synapse.util.logutils import log_function from synapse.util.logutils import log_function
@ -174,11 +176,14 @@ class FederationHandler(BaseHandler):
room = yield self.store.get_room(event.room_id) room = yield self.store.get_room(event.room_id)
if not room: if not room:
yield self.store.store_room( try:
room_id=event.room_id, yield self.store.store_room(
room_creator_user_id="", room_id=event.room_id,
is_public=False, room_creator_user_id="",
) is_public=False,
)
except StoreError:
logger.exception("Failed to store room.")
if not backfilled: if not backfilled:
extra_users = [] extra_users = []