Pass through HTTPError when failing join

This commit is contained in:
Neil Alexander 2021-11-09 10:04:35 +00:00
parent 7d6f606d1c
commit 8ad188109b
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -152,7 +152,7 @@ func (r *FederationSenderInternalAPI) performJoinUsingServer(
// A well-formed HTTP error response that isn't in the 500s isn't fatal,
// so we shouldn't punish the server by backing off.
if httpErr, ok := err.(gomatrix.HTTPError); ok && httpErr.Code < 500 {
return fmt.Errorf("HTTP error %d: %s", httpErr.Code, httpErr.Message)
return httpErr
}
// TODO: Check if the user was not allowed to join the room.
r.statistics.ForServer(serverName).Failure()