Catch room profile errors and anything else that can go wrong

Fixes an issue where things become unhappy when the room profile for a user is missing.
This commit is contained in:
Travis Ralston 2018-11-28 08:57:56 -07:00 committed by Brendan Abolivier
parent b951f35572
commit a527fbaae6

View file

@ -464,6 +464,7 @@ class RoomMemberHandler(object):
@defer.inlineCallbacks @defer.inlineCallbacks
def _send_merged_user_invites(self, requester, room_id): def _send_merged_user_invites(self, requester, room_id):
try:
profile_alias = "#_profile_" + requester.user.localpart + ":" + self.hs.hostname profile_alias = "#_profile_" + requester.user.localpart + ":" + self.hs.hostname
profile_alias = RoomAlias.from_string(profile_alias) profile_alias = RoomAlias.from_string(profile_alias)
profile_room_id, remote_room_hosts = yield self.lookup_room_alias(profile_alias) profile_room_id, remote_room_hosts = yield self.lookup_room_alias(profile_alias)
@ -489,6 +490,8 @@ class RoomMemberHandler(object):
) )
except Exception: except Exception:
logger.exception("Failed to invite %s to %s" % (child_id, room_id)) logger.exception("Failed to invite %s to %s" % (child_id, room_id))
except Exception:
logger.exception("Failed to send invites to children of %s in %s" % (requester.user.to_string(), room_id))
@defer.inlineCallbacks @defer.inlineCallbacks
def send_membership_event( def send_membership_event(