Skip to content

Commit 1247394

Browse files
committed
check for error of type ActivationServiceError
1 parent 29842b8 commit 1247394

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/substrate_gateway/substrate_gateway.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ func (g *substrateGateway) EnsureAccount(activationURL []string, termsAndConditi
5757
Msg("method called")
5858
g.mu.Lock()
5959
defer g.mu.Unlock()
60+
6061
for _, url := range activationURL {
6162
info, err = g.sub.EnsureAccount(g.identity, url, termsAndConditionsLink, termsAndConditionsHash)
6263
// check other activationURL only if EnsureAccount failed with ActivationServiceError
63-
if errors.Is(err, substrate.ActivationServiceError{}) {
64-
log.Debug().Str("activation url", url).Err(err).Msg("failed to EnsureAccount with ActivationServiceError")
65-
continue
64+
if err == nil || !errors.As(err, &substrate.ActivationServiceError{}) {
65+
return
6666
}
67-
return
67+
log.Debug().Str("activation url", url).Err(err).Msg("failed to EnsureAccount with ActivationServiceError")
6868
}
6969
return
7070
}

0 commit comments

Comments
 (0)