diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index 43c1b1bd0ddc1a8fde05e6e1670439bef5cdfce3..59cbf71d78af672251d9e3bd24501cc30b499124 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -237,7 +237,7 @@ class FederationHandler(BaseHandler):
         try:
             yield d
         except defer.CancelledError:
-            raise SynapseError("500", "Unable to join remote room")
+            raise SynapseError(500, "Unable to join remote room")
 
         try:
             yield self.store.store_room(