get proper error msg

pull/5370/head
yann300 1 year ago committed by Aniket
parent e952b2a90b
commit 6c7da10d93
  1. 7
      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)

Loading…
Cancel
Save