aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-11-10 11:58:10 +0800
committerFabio Berger <me@fabioberger.com>2017-11-10 11:58:10 +0800
commitf9c84fb6f4a89e257c022feefefd4cb2978b71ce (patch)
treedb893a58683fecf4253462d71d2249c01f61374c
parent1b145617482486cac3e9d0f9f32b18f6dd58a626 (diff)
parent46e2da24a472560a8ff0fc9b068ec017dd5173dd (diff)
downloaddexon-sol-tools-f9c84fb6f4a89e257c022feefefd4cb2978b71ce.tar
dexon-sol-tools-f9c84fb6f4a89e257c022feefefd4cb2978b71ce.tar.gz
dexon-sol-tools-f9c84fb6f4a89e257c022feefefd4cb2978b71ce.tar.bz2
dexon-sol-tools-f9c84fb6f4a89e257c022feefefd4cb2978b71ce.tar.lz
dexon-sol-tools-f9c84fb6f4a89e257c022feefefd4cb2978b71ce.tar.xz
dexon-sol-tools-f9c84fb6f4a89e257c022feefefd4cb2978b71ce.tar.zst
dexon-sol-tools-f9c84fb6f4a89e257c022feefefd4cb2978b71ce.zip
Merge branch 'orderWatcher' of github.com:0xProject/0x.js into orderWatcher
* 'orderWatcher' of github.com:0xProject/0x.js: Add forgotten file
-rw-r--r--test/utils/report_callback_errors.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/utils/report_callback_errors.ts b/test/utils/report_callback_errors.ts
new file mode 100644
index 000000000..d471b2af2
--- /dev/null
+++ b/test/utils/report_callback_errors.ts
@@ -0,0 +1,14 @@
+import { DoneCallback } from '../../src/types';
+
+export const reportCallbackErrors = (done: DoneCallback) => {
+ return (f: (...args: any[]) => void) => {
+ const wrapped = (...args: any[]) => {
+ try {
+ f(...args);
+ } catch (err) {
+ done(err);
+ }
+ };
+ return wrapped;
+ };
+};