From c877074e2432881d5f0dc52caf32007c88d4a9b9 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 19 Aug 2020 09:21:58 +0200 Subject: [PATCH] fixErrorMessage --- apps/remix-ide/src/app/tabs/runTab/contractDropdown.js | 2 +- apps/remix-ide/src/blockchain/blockchain.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js b/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js index 461f518c8f..c69fcd1dd4 100644 --- a/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js +++ b/apps/remix-ide/src/app/tabs/runTab/contractDropdown.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() diff --git a/apps/remix-ide/src/blockchain/blockchain.js b/apps/remix-ide/src/blockchain/blockchain.js index 81b4a37c3c..5cace4f97d 100644 --- a/apps/remix-ide/src/blockchain/blockchain.js +++ b/apps/remix-ide/src/blockchain/blockchain.js @@ -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`)