Skip to content

Commit

Permalink
Merge pull request #4952 from ipfs/fix/4951
Browse files Browse the repository at this point in the history
report error source when failing to construct private network
  • Loading branch information
whyrusleeping authored May 12, 2018
2 parents da18ca5 + 0aa9c0d commit b3faaad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
8 changes: 2 additions & 6 deletions repo/fsrepo/fsrepo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit b3faaad

Please sign in to comment.