From 5e6b5ccd267162f6b2e35294254cdc78da87c8f9 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Thu, 29 Nov 2018 11:46:28 +0000 Subject: [PATCH] Actually fix exceptions --- synapse/handlers/directory.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/synapse/handlers/directory.py b/synapse/handlers/directory.py index 78dbc2bdae..92a31f6c6e 100644 --- a/synapse/handlers/directory.py +++ b/synapse/handlers/directory.py @@ -259,10 +259,8 @@ class DirectoryHandler(BaseHandler): servers = result["servers"] if not room_id: - raise SynapseError( - 404, + raise NotFoundError( "Room alias %s not found" % (room_alias.to_string(),), - Codes.NOT_FOUND ) hosts = yield self.state.get_current_hosts_in_room(room_id) @@ -303,10 +301,8 @@ class DirectoryHandler(BaseHandler): "servers": result["servers"], }) else: - raise SynapseError( - 404, + raise NotFoundError( "Room alias %r not found" % (room_alias.to_string(),), - Codes.NOT_FOUND ) @defer.inlineCallbacks