mirror of
https://github.com/element-hq/synapse.git
synced 2026-11-04 11:17:51 +00:00
Fixes #19257. When an identity server returns a non-2xx response to `/_matrix/identity/v2/store-invite` during a third-party invite, `ask_id_server_for_third_party_invite` lets the `HttpResponseException` escape. The client receives a 500 `M_UNKNOWN` error and the real cause (for example, `M_THREEPID_IN_USE`) is lost. This change catches `HttpResponseException` and converts it with `to_synapse_error()`, which matches how the other identity server calls in `IdentityHandler` (bind, `requestToken`) already handle error responses. A new test in `ThreepidInviteTestCase` makes the identity server return a 400 `M_THREEPID_IN_USE` error and checks that the client receives the same code and errcode. The test fails on `develop` with `500 != 400` and passes with this change.
2 lines
190 B
Plaintext
2 lines
190 B
Plaintext
Fix a bug where an error from the identity server during a third-party invite caused Synapse to return a 500 error instead of passing the error to the client. Contributed by @RaphaelFakhri.
|