diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-03-15 23:29:55 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-03-21 22:07:51 +0800 |
commit | 3c36135d6c9c4b4deb1985bd71ba6f4002d16d0e (patch) | |
tree | 3bd45d0b07ac2526a2f9a972d79e1b9005f69e9c /packages/deployer/src/utils/error_reporter.ts | |
parent | 02ede26893d5801c827f68d4ffb24c216b873a09 (diff) | |
download | dexon-sol-tools-3c36135d6c9c4b4deb1985bd71ba6f4002d16d0e.tar dexon-sol-tools-3c36135d6c9c4b4deb1985bd71ba6f4002d16d0e.tar.gz dexon-sol-tools-3c36135d6c9c4b4deb1985bd71ba6f4002d16d0e.tar.bz2 dexon-sol-tools-3c36135d6c9c4b4deb1985bd71ba6f4002d16d0e.tar.lz dexon-sol-tools-3c36135d6c9c4b4deb1985bd71ba6f4002d16d0e.tar.xz dexon-sol-tools-3c36135d6c9c4b4deb1985bd71ba6f4002d16d0e.tar.zst dexon-sol-tools-3c36135d6c9c4b4deb1985bd71ba6f4002d16d0e.zip |
Stop printing help on error
Diffstat (limited to 'packages/deployer/src/utils/error_reporter.ts')
-rw-r--r-- | packages/deployer/src/utils/error_reporter.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/deployer/src/utils/error_reporter.ts b/packages/deployer/src/utils/error_reporter.ts new file mode 100644 index 000000000..b28e4fbbe --- /dev/null +++ b/packages/deployer/src/utils/error_reporter.ts @@ -0,0 +1,13 @@ +import { logUtils } from '@0xproject/utils'; + +export function consoleReporter<T>(asyncFn: (arg: T) => Promise<void>) { + const noThrowFnAsync = async (arg: T) => { + try { + const result = await asyncFn(arg); + return result; + } catch (err) { + logUtils.log(`${err}`); + } + }; + return noThrowFnAsync; +} |