Skip to content

Commit

Permalink
fix: fix error display for bad requests
Browse files Browse the repository at this point in the history
  • Loading branch information
nikaaru authored and Ikari-Shinji-re committed Nov 17, 2024
1 parent f97d2d9 commit 82c0381
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions widget/embedded/src/hooks/useConfirmSwap/useConfirmSwap.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 82c0381

Please sign in to comment.