mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 06:07:16 +01:00
multi: wrap all errors
This commit is contained in:
committed by
Andras Banki-Horvath
parent
9a28a4c105
commit
648fb22f63
@@ -192,7 +192,7 @@ func newBackend(miner string, netParams *chaincfg.Params, extraArgs []string,
|
||||
client, err := rpcclient.New(&rpcCfg, nil)
|
||||
if err != nil {
|
||||
_ = cleanUp()
|
||||
return nil, nil, fmt.Errorf("unable to create rpc client: %v",
|
||||
return nil, nil, fmt.Errorf("unable to create rpc client: %w",
|
||||
err)
|
||||
}
|
||||
|
||||
|
||||
@@ -294,14 +294,14 @@ func (hn *HarnessNode) ReadMacaroon(macPath string, timeout time.Duration) (
|
||||
err := wait.NoError(func() error {
|
||||
macBytes, err := ioutil.ReadFile(macPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error reading macaroon file: %v",
|
||||
return fmt.Errorf("error reading macaroon file: %w",
|
||||
err)
|
||||
}
|
||||
|
||||
newMac := &macaroon.Macaroon{}
|
||||
if err = newMac.UnmarshalBinary(macBytes); err != nil {
|
||||
return fmt.Errorf("error unmarshalling macaroon "+
|
||||
"file: %v", err)
|
||||
"file: %w", err)
|
||||
}
|
||||
mac = newMac
|
||||
|
||||
@@ -619,7 +619,7 @@ func (hn *HarnessNode) cleanup() error {
|
||||
if hn.Cfg.backupDBDir != "" {
|
||||
err := os.RemoveAll(hn.Cfg.backupDBDir)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to remove backup dir: %v",
|
||||
return fmt.Errorf("unable to remove backup dir: %w",
|
||||
err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user