9f924e459
038668efd
1
2 3 4 5 6 7 8 9 10 11 12 13 14
import { DoneCallback } from '@0x/types'; export const reportCallbackErrors = (done: DoneCallback) => { return (f: (...args: any[]) => void) => { const wrapped = async (...args: any[]) => { try { f(...args); } catch (err) { done(err); } }; return wrapped; }; };