Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all: Fix improper use of errors.Wrap #4926

Merged
merged 4 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (cbq ClaimableBalancesQuery) Cursor() (int64, string, error) {
}
r = parts[1]
if l < 0 {
return l, r, errors.Wrap(err, "Invalid cursor - first value should be higher than 0")
return l, r, errors.New("Invalid cursor - first value should be higher than 0")
bartekn marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down
4 changes: 2 additions & 2 deletions services/horizon/internal/db2/history/orderbook.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (q *Q) GetOrderBookSummary(ctx context.Context, sellingAsset, buyingAsset x
// we don't expect there to be any inconsistency between levels and offers because
// this function should only be invoked in a repeatable read transaction
if len(levels) != len(offers) {
return result, errors.Wrap(err, "price levels length does not match summaries length")
return result, errors.New("price levels length does not match summaries length")
}
for i, level := range levels {
sum := offers[i]
Expand Down Expand Up @@ -151,7 +151,7 @@ func (q *Q) GetOrderBookSummary(ctx context.Context, sellingAsset, buyingAsset x
} else if sum.Type == "bid" {
result.Bids = append(result.Bids, entry)
} else {
return result, errors.Wrap(err, "invalid offer type")
return result, errors.New("invalid offer type")
}
}

Expand Down
2 changes: 1 addition & 1 deletion services/horizon/internal/db2/history/verify_lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (q *Q) TryStateVerificationLock(ctx context.Context) (bool, error) {
return false, errors.Wrap(err, "error acquiring advisory lock for state verification")
}
if len(acquired) != 1 {
return false, errors.Wrap(err, "invalid response from advisory lock")
return false, errors.New("invalid response from advisory lock")
}
return acquired[0], nil
}