From 277bc3f9b7daf7b415ecc8e2455600dd9194f47d Mon Sep 17 00:00:00 2001 From: PhilReact Date: Wed, 25 Dec 2024 06:12:45 +0200 Subject: [PATCH] fix --- src/background.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/background.ts b/src/background.ts index 4e6c9e6..38eb910 100644 --- a/src/background.ts +++ b/src/background.ts @@ -1818,8 +1818,11 @@ export async function createBuyOrderTx({ crosschainAtInfo, isGateway, foreignBlo } ); - if(!responseFetch?.ok) throw new Error('Failed to submit buy order') const res = await responseFetch.json(); + if(res?.error && res?.message){ + throw new Error(res?.message) + } + if(!responseFetch?.ok) throw new Error('Failed to submit buy order') if (res === false) { responseVar = {