From c8998392cdfcb8691e091f4d37cd23f565fe09d7 Mon Sep 17 00:00:00 2001 From: Nate Spector Date: Fri, 10 Jun 2022 11:44:26 -0700 Subject: [PATCH] feat(dispatchr): add cause for thrown error (#758) --- package.json | 2 +- packages/dispatchr/lib/Dispatcher.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 51be80d8..d9a0fa47 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "format": "prettier --write .", "format:check": "prettier --check .", "lint": "eslint .", - "test": "lerna run lint --since --stream && jest" + "test": "lerna run lint --since --stream && jest --forceExit" }, "devDependencies": { "@babel/cli": "^7.11.6", diff --git a/packages/dispatchr/lib/Dispatcher.js b/packages/dispatchr/lib/Dispatcher.js index 0ef175f6..6c507d89 100644 --- a/packages/dispatchr/lib/Dispatcher.js +++ b/packages/dispatchr/lib/Dispatcher.js @@ -188,7 +188,7 @@ Dispatcher.prototype._throwOrCallErrorHandler = context ); } else { - throw new Error(message); + throw new Error(message, { cause: meta && meta.error }); } };