From 8ad188109bbaaeeb1ea29acbb5d7bcaa0749200d Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Tue, 9 Nov 2021 10:04:35 +0000 Subject: [PATCH] Pass through HTTPError when failing join --- federationsender/internal/perform.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/federationsender/internal/perform.go b/federationsender/internal/perform.go index b342e48cb..3623577f4 100644 --- a/federationsender/internal/perform.go +++ b/federationsender/internal/perform.go @@ -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()