|
|
@ -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) |
|
|
|