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

@@ -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)
}