mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 10:27:46 +08:00
Merge pull request #4952 from ipfs/fix/4951
report error source when failing to construct private network
This commit is contained in:
commit
b3faaad131
@ -193,7 +193,7 @@ func (n *IpfsNode) startOnlineServices(ctx context.Context, routingOption Routin
|
||||
if swarmkey != nil {
|
||||
protec, err = pnet.NewProtector(bytes.NewReader(swarmkey))
|
||||
if err != nil {
|
||||
return err
|
||||
return fmt.Errorf("failed to configure private network: %s", err)
|
||||
}
|
||||
n.PNetFingerprint = protec.Fingerprint()
|
||||
go func() {
|
||||
|
||||
@ -701,15 +701,11 @@ func (r *FSRepo) SwarmKey() ([]byte, error) {
|
||||
f, err := os.Open(spath)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return nil, nil
|
||||
} else {
|
||||
return nil, err
|
||||
err = nil
|
||||
}
|
||||
}
|
||||
defer f.Close()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
return ioutil.ReadAll(f)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user