From 3a14c763c7cac756544c4fab38bef84743c48d9a Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Thu, 20 Jun 2024 13:37:49 +0100 Subject: [PATCH] Catch error for sign message --- libs/remix-ui/run-tab/src/lib/actions/account.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/remix-ui/run-tab/src/lib/actions/account.ts b/libs/remix-ui/run-tab/src/lib/actions/account.ts index a7f7eaa970..7224f33161 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/account.ts +++ b/libs/remix-ui/run-tab/src/lib/actions/account.ts @@ -89,7 +89,8 @@ export const createNewBlockchainAccount = async (plugin: RunTab, dispatch: React export const signMessageWithAddress = (plugin: RunTab, dispatch: React.Dispatch, account: string, message: string, modalContent: (hash: string, data: string) => JSX.Element, passphrase?: string) => { plugin.blockchain.signMessage(message, account, passphrase, (err, msgHash, signedData) => { if (err) { - return plugin.call('notification', 'toast', err) + console.error(err) + return plugin.call('notification', 'toast', typeof err === 'string' ? err : err.message) } dispatch(displayNotification('Signed Message', modalContent(msgHash, signedData), 'OK', null, () => {}, null)) })