Skip to content

Commit

Permalink
feat: reject error so the DApp can throw it
Browse files Browse the repository at this point in the history
  • Loading branch information
Sotatek-HocNguyena committed May 21, 2024
1 parent bbf1623 commit a31a9f0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/lib/ExperimentalContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a31a9f0

Please sign in to comment.