mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-08 05:12:18 -04:00
Fix a number of logged errors caused by remote servers being down. (#10400)
This commit is contained in:
parent
0ae95b3847
commit
7695ca0618
5 changed files with 66 additions and 19 deletions
|
@ -20,7 +20,12 @@ import msgpack
|
|||
from unpaddedbase64 import decode_base64, encode_base64
|
||||
|
||||
from synapse.api.constants import EventTypes, HistoryVisibility, JoinRules
|
||||
from synapse.api.errors import Codes, HttpResponseException
|
||||
from synapse.api.errors import (
|
||||
Codes,
|
||||
HttpResponseException,
|
||||
RequestSendFailed,
|
||||
SynapseError,
|
||||
)
|
||||
from synapse.types import JsonDict, ThirdPartyInstanceID
|
||||
from synapse.util.caches.descriptors import cached
|
||||
from synapse.util.caches.response_cache import ResponseCache
|
||||
|
@ -417,14 +422,17 @@ class RoomListHandler(BaseHandler):
|
|||
repl_layer = self.hs.get_federation_client()
|
||||
if search_filter:
|
||||
# We can't cache when asking for search
|
||||
return await repl_layer.get_public_rooms(
|
||||
server_name,
|
||||
limit=limit,
|
||||
since_token=since_token,
|
||||
search_filter=search_filter,
|
||||
include_all_networks=include_all_networks,
|
||||
third_party_instance_id=third_party_instance_id,
|
||||
)
|
||||
try:
|
||||
return await repl_layer.get_public_rooms(
|
||||
server_name,
|
||||
limit=limit,
|
||||
since_token=since_token,
|
||||
search_filter=search_filter,
|
||||
include_all_networks=include_all_networks,
|
||||
third_party_instance_id=third_party_instance_id,
|
||||
)
|
||||
except (RequestSendFailed, HttpResponseException):
|
||||
raise SynapseError(502, "Failed to fetch room list")
|
||||
|
||||
key = (
|
||||
server_name,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue