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: remove use of errors.Wrap(nil, ...) #1738

Merged
merged 1 commit into from
Sep 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 4 additions & 1 deletion clients/horizon/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,10 @@ func (c *Client) LoadAccountTransactions(accountID string, params ...interface{}
}

err = decodeResponse(resp, &tx)
return tx, errors.Wrap(err, "decoding response to transaction")
if err != nil {
return tx, errors.Wrap(err, "decoding response to transaction")
}
return tx, nil
}

// LoadOperation loads a single operation from Horizon server
Expand Down
5 changes: 4 additions & 1 deletion clients/horizonclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,10 @@ func (c *Client) OperationDetail(id string) (ops operations.Operation, err error
}

ops, err = operations.UnmarshalOperation(baseRecord.GetTypeI(), dataString)
return ops, errors.Wrap(err, "unmarshaling to the correct operation type")
if err != nil {
return ops, errors.Wrap(err, "unmarshaling to the correct operation type")
}
return ops, nil
}

// SubmitTransactionXDR submits a transaction represented as a base64 XDR string to the network. err can be either error object or horizon.Error object.
Expand Down
5 changes: 4 additions & 1 deletion services/ticker/internal/scraper/orderbook_scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ func (c *ScraperConfig) fetchOrderbook(bType, bCode, bIssuer, cType, cCode, cIss
}

err = calcOrderbookStats(&obStats, summary)
return obStats, errors.Wrap(err, "could not calculate orderbook stats")
if err != nil {
return obStats, errors.Wrap(err, "could not calculate orderbook stats")
}
return obStats, nil
}

// calcOrderbookStats calculates the NumBids, BidVolume, BidMax, NumAsks, AskVolume and AskMin
Expand Down