avoid duplicate error logs

pull/1172/head
aniket-engg 4 years ago committed by Aniket
parent b0671004b4
commit dd4b1aa4e5
  1. 4
      libs/remixd/src/services/hardhatClient.ts

@ -24,7 +24,6 @@ export class HardhatClient extends PluginClient {
return new Promise((resolve, reject) => {
if (this.readOnly) {
const errMsg = '[Hardhat Compilation]: Cannot compile in read-only mode'
console.log('\x1b[31m%s\x1b[0m', `${errMsg}`)
return reject(new Error(errMsg))
}
const cmd = `npx hardhat compile --config ${configPath}`
@ -38,8 +37,7 @@ export class HardhatClient extends PluginClient {
result += msg + '\n'
})
child.stderr.on('data', (err) => {
console.log('\x1b[31m%s\x1b[0m', `[Hardhat Compilation]: ${err.toString()}`)
error += err.toString()
error += `[Hardhat Compilation]: ${err.toString()}`
})
child.on('close', () => {
if (error) reject(error)

Loading…
Cancel
Save