Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix inconsistent spelling of 'UNRECOGNIZED' when refering to endpoints #12665

Merged
merged 4 commits into from
May 9, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions synapse/federation/federation_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ def _is_unknown_endpoint(
#
# Dendrite returns a 404 (with a body of "404 page not found");
# Conduit returns a 404 (with no body); and Synapse returns a 400
# with M_UNRECOGNISED.
# with M_UNRECOGNIZED.
#
# This needs to be rather specific as some endpoints truly do return 404
# errors.
Expand Down Expand Up @@ -1006,7 +1006,7 @@ async def _do_send_join(
content=pdu.get_pdu_json(time_now),
)
except HttpResponseException as e:
# If an error is received that is due to an unrecognised endpoint,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this particular change is valid; the protocol might use american spelling for the error code but in a casual comment talking about unrecognised endpoints, I see no harm in writing them with native spelling (and indeed much of the code is using english spelling, so for consistency you might say that this would be more expected), much like we wouldn't force ourselves to misspell referrer if we were talking about the value of a 'Referer' header.

# If an error is received that is due to an unrecognized endpoint,
# fallback to the v1 endpoint. Otherwise, consider it a legitimate error
# and raise.
if not self._is_unknown_endpoint(e):
Expand Down Expand Up @@ -1074,7 +1074,7 @@ async def _do_send_invite(
},
)
except HttpResponseException as e:
# If an error is received that is due to an unrecognised endpoint,
# If an error is received that is due to an unrecognized endpoint,
# fallback to the v1 endpoint if the room uses old-style event IDs.
# Otherwise, consider it a legitimate error and raise.
err = e.to_synapse_error()
Expand Down Expand Up @@ -1136,7 +1136,7 @@ async def _do_send_leave(self, destination: str, pdu: EventBase) -> JsonDict:
content=pdu.get_pdu_json(time_now),
)
except HttpResponseException as e:
# If an error is received that is due to an unrecognised endpoint,
# If an error is received that is due to an unrecognized endpoint,
# fallback to the v1 endpoint. Otherwise, consider it a legitimate error
# and raise.
if not self._is_unknown_endpoint(e):
Expand Down Expand Up @@ -1407,7 +1407,7 @@ async def send_request(
suggested_only=suggested_only,
)
except HttpResponseException as e:
# If an error is received that is due to an unrecognised endpoint,
# If an error is received that is due to an unrecognized endpoint,
# fallback to the unstable endpoint. Otherwise, consider it a
# legitimate error and raise.
if not self._is_unknown_endpoint(e):
Expand Down