multi: wrap all errors

This commit is contained in:
Oliver Gugger
2024-03-07 13:19:28 +01:00
committed by Andras Banki-Horvath
parent 9a28a4c105
commit 648fb22f63
60 changed files with 138 additions and 133 deletions

View File

@@ -533,12 +533,12 @@ func (r *RPCKeyRing) SignMessageSchnorr(keyLoc keychain.KeyLocator,
if err != nil {
considerShutdown(err)
return nil, fmt.Errorf("error signing message in remote "+
"signer instance: %v", err)
"signer instance: %w", err)
}
sigParsed, err := schnorr.ParseSignature(resp.Signature)
if err != nil {
return nil, fmt.Errorf("can't parse schnorr signature: %v",
return nil, fmt.Errorf("can't parse schnorr signature: %w",
err)
}
return sigParsed, nil
@@ -634,7 +634,7 @@ func (r *RPCKeyRing) ComputeInputScript(tx *wire.MsgTx,
// input.
sig, err := r.remoteSign(tx, signDesc, witnessProgram)
if err != nil {
return nil, fmt.Errorf("error signing with remote instance: %v",
return nil, fmt.Errorf("error signing with remote instance: %w",
err)
}
@@ -740,7 +740,7 @@ func (r *RPCKeyRing) MuSig2CreateSession(bipVersion input.MuSig2Version,
resp.TaprootInternalKey,
)
if err != nil {
return nil, fmt.Errorf("error parsing internal key: %v",
return nil, fmt.Errorf("error parsing internal key: %w",
err)
}
}
@@ -1261,7 +1261,7 @@ func connectRPC(hostPort, tlsCertPath, macaroonPath string,
certBytes, err := ioutil.ReadFile(tlsCertPath)
if err != nil {
return nil, fmt.Errorf("error reading TLS cert file %v: %v",
return nil, fmt.Errorf("error reading TLS cert file %v: %w",
tlsCertPath, err)
}
@@ -1273,7 +1273,7 @@ func connectRPC(hostPort, tlsCertPath, macaroonPath string,
macBytes, err := ioutil.ReadFile(macaroonPath)
if err != nil {
return nil, fmt.Errorf("error reading macaroon file %v: %v",
return nil, fmt.Errorf("error reading macaroon file %v: %w",
macaroonPath, err)
}
mac := &macaroon.Macaroon{}
@@ -1297,7 +1297,7 @@ func connectRPC(hostPort, tlsCertPath, macaroonPath string,
defer cancel()
conn, err := grpc.DialContext(ctxt, hostPort, opts...)
if err != nil {
return nil, fmt.Errorf("unable to connect to RPC server: %v",
return nil, fmt.Errorf("unable to connect to RPC server: %w",
err)
}