diff --git a/apps/remix-ide/src/blockchain/blockchain.tsx b/apps/remix-ide/src/blockchain/blockchain.tsx index 3abd4ce1e2..cbd91b8218 100644 --- a/apps/remix-ide/src/blockchain/blockchain.tsx +++ b/apps/remix-ide/src/blockchain/blockchain.tsx @@ -962,11 +962,10 @@ export class Blockchain extends Plugin { cb(null, txResult, address, returnValue) } catch (error) { if (this.isInjectedWeb3()) { - let errorObj = error.replace('Returned error: ', '') - errorObj = JSON.parse(errorObj) - if (errorObj.errorData) { + let errorObj = error.replace('Returned error: ', '').replace('error: ', '') + if (errorObj) { const compiledContracts = await this.call('compilerArtefacts', 'getAllContractDatas') - const injectedError = txExecution.checkError({ errorMessage: errorObj.error, errorData: errorObj.errorData }, compiledContracts) + const injectedError = txExecution.checkError({ errorMessage: errorObj }, compiledContracts) cb(injectedError.message) } else cb(error)