Skip to content

Commit 83251c8

Browse files
authored
Merge pull request #366 from ethereum/fixErrorMessage
Fix Printing error message
2 parents b07b5bc + c877074 commit 83251c8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

apps/remix-ide/src/app/tabs/runTab/contractDropdown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ class ContractDropdownUI {
251251
try {
252252
contractMetadata = await this.runView.call('compilerMetadata', 'deployMetadataOf', selectedContract.name)
253253
} catch (error) {
254-
return statusCb(`creation of ${selectedContract.name} errored: ` + error)
254+
return statusCb(`creation of ${selectedContract.name} errored: ` + (error.message ? error.message : error))
255255
}
256256

257257
const compilerContracts = this.dropdownLogic.getCompilerContracts()

apps/remix-ide/src/blockchain/blockchain.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class Blockchain {
104104
const { continueCb, promptCb, statusCb, finalCb } = callbacks
105105
const constructor = selectedContract.getConstructorInterface()
106106
txFormat.encodeConstructorCallAndLinkLibraries(selectedContract.object, args, constructor, contractMetadata.linkReferences, selectedContract.bytecodeLinkReferences, (error, data) => {
107-
if (error) return statusCb(`creation of ${selectedContract.name} errored: ` + error)
107+
if (error) return statusCb(`creation of ${selectedContract.name} errored: ` + (error.message ? error.message : error))
108108

109109
statusCb(`creation of ${selectedContract.name} pending...`)
110110
this.createContract(selectedContract, data, continueCb, promptCb, confirmationCb, finalCb)
@@ -121,7 +121,7 @@ class Blockchain {
121121
this.runTx({ data: data, useCall: false }, confirmationCb, continueCb, promptCb,
122122
(error, txResult, address) => {
123123
if (error) {
124-
return finalCb(`creation of ${selectedContract.name} errored: ${error}`)
124+
return finalCb(`creation of ${selectedContract.name} errored: ${(error.message ? error.message : error)}`)
125125
}
126126
if (txResult.result.status && txResult.result.status === '0x0') {
127127
return finalCb(`creation of ${selectedContract.name} errored: transaction execution failed`)

0 commit comments

Comments
 (0)