From 82c03811b64a9197680314ac4f506d8680afec0c Mon Sep 17 00:00:00 2001 From: Nikaru Date: Sat, 9 Nov 2024 13:49:49 +0000 Subject: [PATCH] fix: fix error display for bad requests --- .../hooks/useConfirmSwap/useConfirmSwap.helpers.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/widget/embedded/src/hooks/useConfirmSwap/useConfirmSwap.helpers.ts b/widget/embedded/src/hooks/useConfirmSwap/useConfirmSwap.helpers.ts index d1e2bf3434..2bf3f243f4 100644 --- a/widget/embedded/src/hooks/useConfirmSwap/useConfirmSwap.helpers.ts +++ b/widget/embedded/src/hooks/useConfirmSwap/useConfirmSwap.helpers.ts @@ -180,6 +180,17 @@ export function handleQuoteErrors(error: any): ConfirmSwapFetchResult { }; } + if (error?.code === 'ERR_BAD_REQUEST') { + return { + swap: null, + error: { + type: QuoteErrorType.NO_RESULT, + diagnosisMessage: error.response.data.error, + }, + warnings: null, + }; + } + return { swap: null, error: {