Skip to content

Commit

Permalink
fix: lifi final quote failures (#8430)
Browse files Browse the repository at this point in the history
  • Loading branch information
gomesalexandre authored Dec 20, 2024
1 parent 6cfc5c9 commit 38db4d0
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ export async function getTrade({
const routesResponse = await getRoutes(routesRequest)
.then(response => Ok(response))
.catch((e: SDKError) => {
// This shouldn't happen, but if it does (`/routes`) endpoint errors), Li.Fi probably went "down" for that specific request
// We should use the stale rate quote, though if it's a proper limit, `/stepTransaction` would fail too, meaning things will still fail at Tx execution time
// Which is much better than a blank screen
if (quoteOrRate === 'quote') return Ok({ routes: [] })

// This is a rate. All errors re: validation or internal server errors etc should be handled gracefully
const code = (() => {
switch (e.code) {
case LiFiErrorCode.ValidationError:
Expand Down

0 comments on commit 38db4d0

Please sign in to comment.