-
Notifications
You must be signed in to change notification settings - Fork 81
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
Add graceful error handling for failed route quotes #2537
Add graceful error handling for failed route quotes #2537
Conversation
👷 Deploy request for wormhole-connect pending review.Visit the deploys page to approve it
|
👷 Deploy request for wormhole-connect-mainnet pending review.Visit the deploys page to approve it
|
This might be impacted by @artursapek's change of removing the concept of route availability in this PR: #2535 In this case, the route would just not show anymore at all. You two might be want to sync up to discuss how to reconcile this case. It would still be useful to give the user feedback. So if the routes do not show but we are able to get back an error message, we can show it under the input amount field (similar to the existing message about entering an amount exceeding your wallet balance) ![]() |
@Wesleyleung fair point. right now I dont think the to surface errors when fetching a quote, the correct way would be to aggregate them from the "get quote" responses. that's where we would have errors like "amount is too small" etc. however there's the question of how we handle multiple responses... we could have any combination of 1 or more errors, and 1 or more successful quotes. do we show the errors when we had at least one successful quote? if we have multiple errors, how do we pick which one to show? it's probably best to have structured errors, so that "minimum amount" is a standard type we know about and can take the minimum of if there's multiple of these errors, for example. doing this properly is definitely a biggest task. |
@artursapek with current fix, it's displaying quote error in the Route box, which has a failed qoute request. I don't think it's interfering with |
I think standardizing error types and aggregating them makes sense. As a quick fix, I think keeping the "greyed out" route concept with a "local" error message like what Armen has is ok until a more complete solution can be done properly. A better UX could be to structure these error types such that if at least 1 or more route is successful, show them and do not produce an error in the UI (show in console though). Then, as an example, if I type in too low an amount where all routes would become "disqualified", I would see a single error message and zero routes. This single error message would tell the user to type in the common floor amount among all returned error thresholds. Example:
Error message: "Amount too small (min ~0.05 sol)"
As I type in higher amounts, more routes that qualify would progressively show. I'm not sure what are the other error types that can be structured in this way other than min, but we can start with this one and as we find more, come up with a structure for them where a common denominator can be determined to tell the user when there are more than 1 of that error type. |
Adding @kev1n-peters for thoughts too |
There's also the case where there are distinct error types to compare: min amount type vs something else, and we would need to come up with logic to disambiguate those. |
The SDK should return structured errors that are route agnostic. Created this issue for tracking: wormhole-foundation/wormhole-sdk-ts#690 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There a few comments, rest is LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Tickets:
Route Errors
UI:
