summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-11-19 17:14:14 +0000
committerMark Haines <mark.haines@matrix.org>2014-11-19 17:14:14 +0000
commit8993affdc06be35b3680501ecd14a8d23901e497 (patch)
treef8bb1b0556ec1ec18f65213344e3caaa842c5173 /synapse/handlers
parentremove demo webserver since synapse serves up the webclient itself (diff)
downloadsynapse-8993affdc06be35b3680501ecd14a8d23901e497.tar.xz
SYN-153: Raise 404 if room alias is not found
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/directory.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/synapse/handlers/directory.py b/synapse/handlers/directory.py
index 98ac0684fc..ed9b0f8551 100644
--- a/synapse/handlers/directory.py
+++ b/synapse/handlers/directory.py
@@ -122,10 +122,14 @@ class DirectoryHandler(BaseHandler):
             room_alias
         )
 
-        defer.returnValue({
-            "room_id": result.room_id,
-            "servers": result.servers,
-        })
+        if result is not None:
+            defer.returnValue({
+                "room_id": result.room_id,
+                "servers": result.servers,
+            })
+        else:
+            raise SynapseError(404, "Room alias \"%s\" not found", room_alias)
+
 
     @defer.inlineCallbacks
     def send_room_alias_update_event(self, user_id, room_id):