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) cb(null, txResult, address, returnValue)
} catch (error) { } catch (error) {
if (this.isInjectedWeb3()) { if (this.isInjectedWeb3()) {
let errorObj = error.replace('Returned error: ', '') let errorObj = error.replace('Returned error: ', '').replace('error: ', '')
errorObj = JSON.parse(errorObj) if (errorObj) {
if (errorObj.errorData) {
const compiledContracts = await this.call('compilerArtefacts', 'getAllContractDatas') 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) cb(injectedError.message)
} else } else
cb(error) cb(error)

Loading…
Cancel
Save