mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-30 23:53:41 +02:00
multi: wrap all errors
This commit is contained in:
committed by
Andras Banki-Horvath
parent
9a28a4c105
commit
648fb22f63
@@ -70,7 +70,7 @@ func WriteElement(w io.Writer, element interface{}) error {
|
||||
|
||||
if e.PubKey != nil {
|
||||
if err := binary.Write(w, byteOrder, true); err != nil {
|
||||
return fmt.Errorf("error writing serialized element: %s", err)
|
||||
return fmt.Errorf("error writing serialized element: %w", err)
|
||||
}
|
||||
|
||||
return WriteElement(w, e.PubKey)
|
||||
|
@@ -1140,7 +1140,7 @@ func deserializeChanEdgePolicy(r io.Reader,
|
||||
|
||||
node, err := fetchLightningNode(nodes, pub[:])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to fetch node: %x, %v",
|
||||
return nil, fmt.Errorf("unable to fetch node: %x, %w",
|
||||
pub[:], err)
|
||||
}
|
||||
edge.Node = &node
|
||||
|
@@ -516,7 +516,7 @@ func MigratePruneEdgeUpdateIndex(tx kvdb.RwTx) error {
|
||||
// well.
|
||||
edgeIndex, err := edges.CreateBucketIfNotExists(edgeIndexBucket)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error creating edge index bucket: %s", err)
|
||||
return fmt.Errorf("error creating edge index bucket: %w", err)
|
||||
}
|
||||
if edgeIndex == nil {
|
||||
return fmt.Errorf("unable to create/fetch edge index " +
|
||||
@@ -546,7 +546,7 @@ func MigratePruneEdgeUpdateIndex(tx kvdb.RwTx) error {
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to gather existing edge policies: %v",
|
||||
return fmt.Errorf("unable to gather existing edge policies: %w",
|
||||
err)
|
||||
}
|
||||
|
||||
@@ -560,7 +560,7 @@ func MigratePruneEdgeUpdateIndex(tx kvdb.RwTx) error {
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to gather existing edge updates: %v",
|
||||
return fmt.Errorf("unable to gather existing edge updates: %w",
|
||||
err)
|
||||
}
|
||||
|
||||
|
@@ -136,7 +136,7 @@ func encodeAmount(msat lnwire.MilliSatoshi) (string, error) {
|
||||
// Should always be expressible in pico BTC.
|
||||
pico, err := fromMSat['p'](msat)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("unable to express %d msat as pBTC: %v",
|
||||
return "", fmt.Errorf("unable to express %d msat as pBTC: %w",
|
||||
msat, err)
|
||||
}
|
||||
shortened := strconv.FormatUint(pico, 10) + "p"
|
||||
|
Reference in New Issue
Block a user