multi: wrap all errors

This commit is contained in:
Oliver Gugger authored and Andras Banki-Horvath committed 2024-04-11 15:04:03 +02:00
1 parent 9a28a4c105
commit 648fb22f63
60 files changed
+138 -133

No files matched your search

+2 -2
View File
@@ -252,7 +252,7 @@ func (s *Server) ImportGraph(ctx context.Context,
}
if err := graphDB.AddLightningNode(node); err != nil {
return nil, fmt.Errorf("unable to add node %v: %v",
return nil, fmt.Errorf("unable to add node %v: %w",
rpcNode.PubKey, err)
}
@@ -285,7 +285,7 @@ func (s *Server) ImportGraph(ctx context.Context,
edge.ChannelPoint = *channelPoint
if err := graphDB.AddChannelEdge(edge); err != nil {
return nil, fmt.Errorf("unable to add edge %v: %v",
return nil, fmt.Errorf("unable to add edge %v: %w",
rpcEdge.ChanPoint, err)
}
+2 -2
View File
@@ -1140,7 +1140,7 @@ func toPairSnapshot(pairResult *PairHistory) (*routing.MissionControlPairSnapsho
pairResult.History.FailTime,
)
if err != nil {
return nil, fmt.Errorf("%v invalid failure: %v", pairPrefix,
return nil, fmt.Errorf("%v invalid failure: %w", pairPrefix,
err)
}
@@ -1150,7 +1150,7 @@ func toPairSnapshot(pairResult *PairHistory) (*routing.MissionControlPairSnapsho
pairResult.History.SuccessTime,
)
if err != nil {
return nil, fmt.Errorf("%v invalid success: %v", pairPrefix,
return nil, fmt.Errorf("%v invalid success: %w", pairPrefix,
err)
}
+6 -6
View File
@@ -710,14 +710,14 @@ func (s *Server) VerifyMessage(_ context.Context,
// for Schnorr signatures.
pubkey, err := schnorr.ParsePubKey(in.Pubkey)
if err != nil {
return nil, fmt.Errorf("unable to parse pubkey: %v",
return nil, fmt.Errorf("unable to parse pubkey: %w",
err)
}
sigParsed, err := schnorr.ParseSignature(in.Signature)
if err != nil {
return nil, fmt.Errorf("can't parse Schnorr "+
"signature: %v", err)
"signature: %w", err)
}
var digest []byte
@@ -746,7 +746,7 @@ func (s *Server) VerifyMessage(_ context.Context,
}
sig, err := wireSig.ToSignature()
if err != nil {
return nil, fmt.Errorf("failed to convert from wire format: %v",
return nil, fmt.Errorf("failed to convert from wire format: %w",
err)
}
@@ -874,7 +874,7 @@ func (s *Server) MuSig2CombineKeys(_ context.Context,
// Are there any tweaks to apply to the combined public key?
tweaks, err := UnmarshalTweaks(in.Tweaks, in.TaprootTweak)
if err != nil {
return nil, fmt.Errorf("error unmarshaling tweak options: %v",
return nil, fmt.Errorf("error unmarshaling tweak options: %w",
err)
}
@@ -1014,7 +1014,7 @@ func (s *Server) MuSig2CreateSession(_ context.Context,
// Are there any tweaks to apply to the combined public key?
tweaks, err := UnmarshalTweaks(in.Tweaks, in.TaprootTweak)
if err != nil {
return nil, fmt.Errorf("error unmarshaling tweak options: %v",
return nil, fmt.Errorf("error unmarshaling tweak options: %w",
err)
}
@@ -1139,7 +1139,7 @@ func (s *Server) MuSig2CombineSig(_ context.Context,
in.OtherPartialSignatures,
)
if err != nil {
return nil, fmt.Errorf("error parsing partial signatures: %v",
return nil, fmt.Errorf("error parsing partial signatures: %w",
err)
}
+2 -2
View File
@@ -1038,7 +1038,7 @@ func (w *WalletKit) BumpFee(ctx context.Context,
// with an unconfirmed transaction.
_, currentHeight, err := w.cfg.Chain.GetBestBlock()
if err != nil {
return nil, fmt.Errorf("unable to retrieve current height: %v",
return nil, fmt.Errorf("unable to retrieve current height: %w",
err)
}
@@ -2607,7 +2607,7 @@ func (w *WalletKit) ImportTapscript(_ context.Context,
taprootScope := waddrmgr.KeyScopeBIP0086
addr, err := w.cfg.Wallet.ImportTaprootScript(taprootScope, tapscript)
if err != nil {
return nil, fmt.Errorf("error importing script into wallet: %v",
return nil, fmt.Errorf("error importing script into wallet: %w",
err)
}
+2 -1
View File
@@ -208,7 +208,8 @@ func (c *WatchtowerClient) AddTower(ctx context.Context,
c.cfg.Resolver,
)
if err != nil {
return nil, fmt.Errorf("invalid address %v: %v", req.Address, err)
return nil, fmt.Errorf("invalid address %v: %w", req.Address,
err)
}
towerAddr := &lnwire.NetAddress{