Merge pull request #366 from ethereum/fixErrorMessage

Fix Printing error message
pull/368/head
yann300 4 years ago committed by GitHub
commit 83251c827d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      apps/remix-ide/src/app/tabs/runTab/contractDropdown.js
  2. 4
      apps/remix-ide/src/blockchain/blockchain.js

@ -251,7 +251,7 @@ class ContractDropdownUI {
try {
contractMetadata = await this.runView.call('compilerMetadata', 'deployMetadataOf', selectedContract.name)
} catch (error) {
return statusCb(`creation of ${selectedContract.name} errored: ` + error)
return statusCb(`creation of ${selectedContract.name} errored: ` + (error.message ? error.message : error))
}
const compilerContracts = this.dropdownLogic.getCompilerContracts()

@ -104,7 +104,7 @@ class Blockchain {
const { continueCb, promptCb, statusCb, finalCb } = callbacks
const constructor = selectedContract.getConstructorInterface()
txFormat.encodeConstructorCallAndLinkLibraries(selectedContract.object, args, constructor, contractMetadata.linkReferences, selectedContract.bytecodeLinkReferences, (error, data) => {
if (error) return statusCb(`creation of ${selectedContract.name} errored: ` + error)
if (error) return statusCb(`creation of ${selectedContract.name} errored: ` + (error.message ? error.message : error))
statusCb(`creation of ${selectedContract.name} pending...`)
this.createContract(selectedContract, data, continueCb, promptCb, confirmationCb, finalCb)
@ -121,7 +121,7 @@ class Blockchain {
this.runTx({ data: data, useCall: false }, confirmationCb, continueCb, promptCb,
(error, txResult, address) => {
if (error) {
return finalCb(`creation of ${selectedContract.name} errored: ${error}`)
return finalCb(`creation of ${selectedContract.name} errored: ${(error.message ? error.message : error)}`)
}
if (txResult.result.status && txResult.result.status === '0x0') {
return finalCb(`creation of ${selectedContract.name} errored: transaction execution failed`)

Loading…
Cancel
Save