Commit 3a739476 authored by Tina's avatar Tina Committed by GitHub

fix: Catch routing-api v2 no liquidity error case (#6742)

catch URA no liquidity case
parent 04e4335c
...@@ -80,7 +80,10 @@ export const routingApiV2 = createApi({ ...@@ -80,7 +80,10 @@ export const routingApiV2 = createApi({
// cast as any here because we do a runtime check on it being an object before indexing into .errorCode // cast as any here because we do a runtime check on it being an object before indexing into .errorCode
const errorData = response.error.data as any const errorData = response.error.data as any
// NO_ROUTE should be treated as a valid response to prevent retries. // NO_ROUTE should be treated as a valid response to prevent retries.
if (typeof errorData === 'object' && errorData?.errorCode === 'NO_ROUTE') { if (
typeof errorData === 'object' &&
(errorData?.errorCode === 'NO_ROUTE' || errorData?.detail === 'No quotes available')
) {
return { data: { state: QuoteState.NOT_FOUND } } return { data: { state: QuoteState.NOT_FOUND } }
} }
} catch { } catch {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment