From a31a9f091ae4f3c6f969472464b2e631257b2c3d Mon Sep 17 00:00:00 2001 From: Sotatek-HocNguyena Date: Tue, 21 May 2024 11:08:16 +0700 Subject: [PATCH] feat: reject error so the DApp can throw it --- src/lib/ExperimentalContainer.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/ExperimentalContainer.ts b/src/lib/ExperimentalContainer.ts index 359355a..9a2aeb1 100644 --- a/src/lib/ExperimentalContainer.ts +++ b/src/lib/ExperimentalContainer.ts @@ -201,7 +201,13 @@ export const buildApiCalls = ( params = params ?? []; return new Promise((resolve, reject) => { - meerkat.rpc(address, endpoint, [method, ...params], (result: any) => resolve(result)); + meerkat.rpc(address, endpoint, [method, ...params], (result: any) => { + if (result.error) { + reject(result.error) + } else { + resolve(result) + } + }); }); }; } else {