diff options
author | EuAndreh <eu@euandre.org> | 2024-03-15 15:41:25 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-03-15 15:41:25 -0300 |
commit | 4df5056eb1c09d437e85c96b7dc16b1af1794668 (patch) | |
tree | fcc9a49636cc9251ab86094f4b06f24cf40cf561 | |
parent | src/hero.mjs: Add makeUpgradeListener() (diff) | |
download | papod-4df5056eb1c09d437e85c96b7dc16b1af1794668.tar.gz papod-4df5056eb1c09d437e85c96b7dc16b1af1794668.tar.xz |
src/hero.mjs: Include stacktrace in 500 log entry
-rw-r--r-- | src/hero.mjs | 1 | ||||
-rw-r--r-- | tests/js/hero.mjs | 6 |
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", }], ); }); |