summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/hero.mjs1
-rw-r--r--tests/js/hero.mjs6
2 files changed, 5 insertions, 2 deletions
diff --git a/src/hero.mjs b/src/hero.mjs
index 4634e70..5169284 100644
--- a/src/hero.mjs
+++ b/src/hero.mjs
@@ -94,6 +94,7 @@ export const interceptorsFn = ({
id: req.id,
type: "server-error-interceptor",
message: error.message,
+ stacktrace: error.stack
});
return {
status: 500,
diff --git a/tests/js/hero.mjs b/tests/js/hero.mjs
index 0c04db8..1c34738 100644
--- a/tests/js/hero.mjs
+++ b/tests/js/hero.mjs
@@ -368,11 +368,12 @@ const test_interceptorsFn = async t => {
},
);
assert.deepEqual(
- contents,
+ contents.map(o => ({ ...o, stacktrace: typeof o.stacktrace })),
[{
id: 123,
type: "server-error-interceptor",
message: `Missing "status"`,
+ stacktrace: "string",
}],
);
});
@@ -391,11 +392,12 @@ const test_interceptorsFn = async t => {
},
);
assert.deepEqual(
- contents,
+ contents.map(o => ({ ...o, stacktrace: typeof o.stacktrace })),
[{
id: "some ID",
type: "server-error-interceptor",
message: "My test error message",
+ stacktrace: "string",
}],
);
});