aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-compiler/src/utils/compiler.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-12-19 21:11:08 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-12-19 22:41:48 +0800
commit657b698e1eba7fde2322bb81547eba26491c0af4 (patch)
tree89572e6217df07336f584d56ac0c49e6385e5601 /packages/sol-compiler/src/utils/compiler.ts
parent8ddf925a8feb41e240871fe0d57e0f40b9bb4896 (diff)
downloaddexon-0x-contracts-657b698e1eba7fde2322bb81547eba26491c0af4.tar
dexon-0x-contracts-657b698e1eba7fde2322bb81547eba26491c0af4.tar.gz
dexon-0x-contracts-657b698e1eba7fde2322bb81547eba26491c0af4.tar.bz2
dexon-0x-contracts-657b698e1eba7fde2322bb81547eba26491c0af4.tar.lz
dexon-0x-contracts-657b698e1eba7fde2322bb81547eba26491c0af4.tar.xz
dexon-0x-contracts-657b698e1eba7fde2322bb81547eba26491c0af4.tar.zst
dexon-0x-contracts-657b698e1eba7fde2322bb81547eba26491c0af4.zip
Add sol-compiler watch mode
Diffstat (limited to 'packages/sol-compiler/src/utils/compiler.ts')
-rw-r--r--packages/sol-compiler/src/utils/compiler.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/sol-compiler/src/utils/compiler.ts b/packages/sol-compiler/src/utils/compiler.ts
index 034f72f8d..486d8bedd 100644
--- a/packages/sol-compiler/src/utils/compiler.ts
+++ b/packages/sol-compiler/src/utils/compiler.ts
@@ -12,6 +12,7 @@ import { binPaths } from '../solc/bin_paths';
import { constants } from './constants';
import { fsWrapper } from './fs_wrapper';
+import { CompilationError } from './types';
/**
* Gets contract data on network or returns if an artifact does not exist.
@@ -147,13 +148,13 @@ function printCompilationErrorsAndWarnings(solcErrors: solc.SolcError[]): void {
if (!_.isEmpty(errors)) {
errors.forEach(error => {
const normalizedErrMsg = getNormalizedErrMsg(error.formattedMessage || error.message);
- logUtils.warn(chalk.red(normalizedErrMsg));
+ logUtils.log(chalk.red('error'), normalizedErrMsg);
});
- throw new Error('Compilation errors encountered');
+ throw new CompilationError(errors.length);
} else {
warnings.forEach(warning => {
const normalizedWarningMsg = getNormalizedErrMsg(warning.formattedMessage || warning.message);
- logUtils.warn(chalk.yellow(normalizedWarningMsg));
+ logUtils.log(chalk.yellow('warning'), normalizedWarningMsg);
});
}
}