From f26f7c5cc8324f8ad4921a1e5626b6e127a0207c Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 6 Mar 2020 16:01:38 +0000 Subject: [PATCH] Simplify error handling for recursion --- federationapi/routing/send.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/federationapi/routing/send.go b/federationapi/routing/send.go index 4ee7d2e84..079e121f9 100644 --- a/federationapi/routing/send.go +++ b/federationapi/routing/send.go @@ -220,19 +220,16 @@ retryAllowedState: if s.EventID() != missing.AuthEventID { continue } - if serr := t.processEventWithMissingState(s); serr == nil { - // If there was no error retrieving the event from federation then - // we assume that it succeeded, so retry the original state check + err = t.processEventWithMissingState(s) + // If there was no error retrieving the event from federation then + // we assume that it succeeded, so retry the original state check + if err == nil { goto retryAllowedState - } else { - // An error occurred so let's not do anything further - return err } } default: - // Some other error condition happened that wasn't a missing auth event - return err } + return err } // pass the event along with the state to the roomserver return t.producer.SendEventWithState(t.context, state, e)