From 3c36135d6c9c4b4deb1985bd71ba6f4002d16d0e Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 15 Mar 2018 16:29:55 +0100 Subject: Stop printing help on error --- packages/deployer/src/utils/error_reporter.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 packages/deployer/src/utils/error_reporter.ts (limited to 'packages/deployer/src/utils') 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(asyncFn: (arg: T) => Promise) { + const noThrowFnAsync = async (arg: T) => { + try { + const result = await asyncFn(arg); + return result; + } catch (err) { + logUtils.log(`${err}`); + } + }; + return noThrowFnAsync; +} -- cgit v1.2.3