mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-09-07 15:31:54 +00:00
Make minor clarifications to the error messages given when we fail to join a room via any server. (#13160)
This commit is contained in:
parent
4f3082d6bf
commit
39be5bc550
1
changelog.d/13160.misc
Normal file
1
changelog.d/13160.misc
Normal file
@ -0,0 +1 @@
|
|||||||
|
Make minor clarifications to the error messages given when we fail to join a room via any server.
|
@ -725,6 +725,12 @@ class FederationClient(FederationBase):
|
|||||||
if failover_errcodes is None:
|
if failover_errcodes is None:
|
||||||
failover_errcodes = ()
|
failover_errcodes = ()
|
||||||
|
|
||||||
|
if not destinations:
|
||||||
|
# Give a bit of a clearer message if no servers were specified at all.
|
||||||
|
raise SynapseError(
|
||||||
|
502, f"Failed to {description} via any server: No servers specified."
|
||||||
|
)
|
||||||
|
|
||||||
for destination in destinations:
|
for destination in destinations:
|
||||||
if destination == self.server_name:
|
if destination == self.server_name:
|
||||||
continue
|
continue
|
||||||
@ -774,7 +780,7 @@ class FederationClient(FederationBase):
|
|||||||
"Failed to %s via %s", description, destination, exc_info=True
|
"Failed to %s via %s", description, destination, exc_info=True
|
||||||
)
|
)
|
||||||
|
|
||||||
raise SynapseError(502, "Failed to %s via any server" % (description,))
|
raise SynapseError(502, f"Failed to {description} via any server")
|
||||||
|
|
||||||
async def make_membership_event(
|
async def make_membership_event(
|
||||||
self,
|
self,
|
||||||
|
@ -1679,7 +1679,11 @@ class RoomMemberMasterHandler(RoomMemberHandler):
|
|||||||
]
|
]
|
||||||
|
|
||||||
if len(remote_room_hosts) == 0:
|
if len(remote_room_hosts) == 0:
|
||||||
raise SynapseError(404, "No known servers")
|
raise SynapseError(
|
||||||
|
404,
|
||||||
|
"Can't join remote room because no servers "
|
||||||
|
"that are in the room have been provided.",
|
||||||
|
)
|
||||||
|
|
||||||
check_complexity = self.hs.config.server.limit_remote_rooms.enabled
|
check_complexity = self.hs.config.server.limit_remote_rooms.enabled
|
||||||
if (
|
if (
|
||||||
|
@ -1873,7 +1873,10 @@ class JoinAliasRoomTestCase(unittest.HomeserverTestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(HTTPStatus.NOT_FOUND, channel.code, msg=channel.json_body)
|
self.assertEqual(HTTPStatus.NOT_FOUND, channel.code, msg=channel.json_body)
|
||||||
self.assertEqual("No known servers", channel.json_body["error"])
|
self.assertEqual(
|
||||||
|
"Can't join remote room because no servers that are in the room have been provided.",
|
||||||
|
channel.json_body["error"],
|
||||||
|
)
|
||||||
|
|
||||||
def test_room_is_not_valid(self) -> None:
|
def test_room_is_not_valid(self) -> None:
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user