Run go-instrument-errors to wrap errors

This commit is contained in:
Eduard S
2020-12-18 13:39:42 +01:00
parent b59f790c04
commit b1a8384f27
10 changed files with 30 additions and 30 deletions

View File

@@ -53,7 +53,7 @@ type L1Tx struct {
func NewL1Tx(tx *L1Tx) (*L1Tx, error) {
txTypeOld := tx.Type
if err := tx.SetType(); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
}
// If original Type doesn't match the correct one, return error
if txTypeOld != "" && txTypeOld != tx.Type {
@@ -63,7 +63,7 @@ func NewL1Tx(tx *L1Tx) (*L1Tx, error) {
txIDOld := tx.TxID
if err := tx.SetID(); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
}
// If original TxID doesn't match the correct one, return error
if txIDOld != (TxID{}) && txIDOld != tx.TxID {

View File

@@ -27,7 +27,7 @@ type L2Tx struct {
func NewL2Tx(tx *L2Tx) (*L2Tx, error) {
txTypeOld := tx.Type
if err := tx.SetType(); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
}
// If original Type doesn't match the correct one, return error
if txTypeOld != "" && txTypeOld != tx.Type {
@@ -37,7 +37,7 @@ func NewL2Tx(tx *L2Tx) (*L2Tx, error) {
txIDOld := tx.TxID
if err := tx.SetID(); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
}
// If original TxID doesn't match the correct one, return error
if txIDOld != (TxID{}) && txIDOld != tx.TxID {

View File

@@ -53,7 +53,7 @@ type PoolL2Tx struct {
func NewPoolL2Tx(tx *PoolL2Tx) (*PoolL2Tx, error) {
txTypeOld := tx.Type
if err := tx.SetType(); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
}
// If original Type doesn't match the correct one, return error
if txTypeOld != "" && txTypeOld != tx.Type {
@@ -63,7 +63,7 @@ func NewPoolL2Tx(tx *PoolL2Tx) (*PoolL2Tx, error) {
txIDOld := tx.TxID
if err := tx.SetID(); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
}
// If original TxID doesn't match the correct one, return error
if txIDOld != (TxID{}) && txIDOld != tx.TxID {