From c0a4599b2fe8fd18df88e508acb602a22365f80b Mon Sep 17 00:00:00 2001 From: Devon Hudson Date: Tue, 25 Apr 2023 17:15:46 -0600 Subject: [PATCH] Check the correct error code in PerformJoin --- federationapi/internal/perform.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/federationapi/internal/perform.go b/federationapi/internal/perform.go index 1cfc427cf..38e4d6248 100644 --- a/federationapi/internal/perform.go +++ b/federationapi/internal/perform.go @@ -163,13 +163,13 @@ func (r *FederationInternalAPI) performJoinUsingServer( } response, joinErr := gomatrixserverlib.PerformJoin(ctx, r, joinInput) - if err != nil { + if joinErr != nil { if !joinErr.Reachable { r.statistics.ForServer(joinErr.ServerName).Failure() } else { r.statistics.ForServer(joinErr.ServerName).Success(statistics.SendDirect) } - return err + return joinErr } r.statistics.ForServer(serverName).Success(statistics.SendDirect) if response == nil {