Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Prev Previous commit
Next Next commit
Re-use is_unknown_endpoint.
  • Loading branch information
clokep committed Mar 30, 2023
commit 9e5a0c7ca4f0b80f04a37d21eed33750f8c4585b
4 changes: 2 additions & 2 deletions synapse/appservice/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ async def _send_with_fallbacks(
uri = f"{service.url}{prefix}{path}"
try:
return await func(uri, *args, **kwargs)
except CodeMessageException as e:
except HttpResponseException as e:
# If an error is received that is due to an unrecognised path,
# fallback to next path (if one exists). Otherwise, consider it
# a legitimate error and raise.
if prefixes and (e.code == 404 or e.code == 405):
if prefixes and is_unknown_endpoint(e):
continue
raise

Expand Down