Skip to content

Commit

Permalink
Turn verification error into estimator error (#2489)
Browse files Browse the repository at this point in the history
# Description
I initially classified errors coming from verification incorrectly.
`ProtocolErrors` will actually get logged as errors which leads to these
[alerts](https://cowservices.slack.com/archives/C0371SB243E/p1709821653091049).
However, if we have to discard a quote because it's actually not good
the estimator is actually at fault.
Those errors will not lead to alerts. Also the user will receive a `400`
response (no liquidity) instead of `500` (internal server error).

# Changes
Turned `TooInaccurate` error into an `EstimatorError` instead of
`ProtocolError`.
  • Loading branch information
MartinquaXD authored Mar 7, 2024
1 parent f30e9ff commit 79ec9d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/shared/src/price_estimation/trade_finder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl Inner {
return verifier
.verify(&price_query, verification, trade.clone())
.await
.map_err(PriceEstimationError::ProtocolInternal);
.map_err(PriceEstimationError::EstimatorInternal);
}

if query.verification.is_some() {
Expand Down

0 comments on commit 79ec9d9

Please sign in to comment.