summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-11-29 11:46:28 +0000
committerErik Johnston <erik@matrix.org>2018-11-29 11:46:28 +0000
commit230474b6206b51f5ee11763dfc70e331c8993964 (patch)
treea5e0f955751155bcf2caeeb840385033a3a8b9f7
parentDon't log ERROR when no profile exists (diff)
downloadsynapse-github/experimental2.tar.xz
Actually fix exceptions github/experimental2 experimental2
-rw-r--r--synapse/handlers/directory.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/synapse/handlers/directory.py b/synapse/handlers/directory.py
index 0699731c13..8a96489a32 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
             )
 
         users = yield self.state.get_current_user_in_room(room_id)
@@ -302,10 +300,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