Commit dd4b1aa4 authored by aniket-engg's avatar aniket-engg Committed by Aniket

avoid duplicate error logs

parent b0671004
...@@ -24,7 +24,6 @@ export class HardhatClient extends PluginClient { ...@@ -24,7 +24,6 @@ export class HardhatClient extends PluginClient {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (this.readOnly) { if (this.readOnly) {
const errMsg = '[Hardhat Compilation]: Cannot compile in read-only mode' const errMsg = '[Hardhat Compilation]: Cannot compile in read-only mode'
console.log('\x1b[31m%s\x1b[0m', `${errMsg}`)
return reject(new Error(errMsg)) return reject(new Error(errMsg))
} }
const cmd = `npx hardhat compile --config ${configPath}` const cmd = `npx hardhat compile --config ${configPath}`
...@@ -38,8 +37,7 @@ export class HardhatClient extends PluginClient { ...@@ -38,8 +37,7 @@ export class HardhatClient extends PluginClient {
result += msg + '\n' result += msg + '\n'
}) })
child.stderr.on('data', (err) => { child.stderr.on('data', (err) => {
console.log('\x1b[31m%s\x1b[0m', `[Hardhat Compilation]: ${err.toString()}`) error += `[Hardhat Compilation]: ${err.toString()}`
error += err.toString()
}) })
child.on('close', () => { child.on('close', () => {
if (error) reject(error) if (error) reject(error)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment