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