fix: variable bad scoping
Some checks reported warnings
Cadoles/go-http-peering/pipeline/head This commit is unstable
Some checks reported warnings
Cadoles/go-http-peering/pipeline/head This commit is unstable
This commit is contained in:
parent
635f170762
commit
51bdf4d015
@ -54,13 +54,14 @@ func AdvertiseHandler(store peering.Store, key *rsa.PublicKey, funcs ...OptionFu
|
||||
return
|
||||
}
|
||||
|
||||
if _, err := store.Get(serverClaims.PeerID); err == nil {
|
||||
_, err = store.Get(serverClaims.PeerID)
|
||||
if err == nil {
|
||||
logger.Printf("[WARN] %s", errors.WithStack(ErrPeerIDAlreadyInUse))
|
||||
options.ErrorHandler(w, r, ErrPeerIDAlreadyInUse)
|
||||
return
|
||||
}
|
||||
|
||||
if err != peering.ErrPeerNotFound {
|
||||
if !errors.Is(err, peering.ErrPeerNotFound) {
|
||||
logger.Printf("[ERROR] %+v", errors.WithStack(err))
|
||||
options.ErrorHandler(w, r, err)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user