aboutsummaryrefslogtreecommitdiffstats
path: root/packages/deployer/src/utils/error_reporter.ts
blob: b28e4fbbe4827adccd330fb0cbc4b27783bce0a3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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;
}