Skip to content

Commit efd68fe

Browse files
authored
Merge pull request #215 from AthennaIO/develop
chore(handler): add all error details to log
2 parents 4090913 + 7e20f2d commit efd68fe

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@athenna/http",
3-
"version": "5.29.0",
3+
"version": "5.30.0",
44
"description": "The Athenna Http server. Built on top of fastify.",
55
"license": "MIT",
66
"author": "João Lenon <[email protected]>",

src/handlers/HttpExceptionHandler.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,16 @@ export class HttpExceptionHandler {
7777
)
7878

7979
if (isUsingJsonFormatter) {
80-
Log.channelOrVanilla('exception').error(error)
80+
Log.channelOrVanilla('exception').error({
81+
name: error.name,
82+
code: error.code,
83+
status: error.status,
84+
message: error.message,
85+
help: error.help,
86+
cause: error.cause,
87+
details: error.details,
88+
stack: error.stack
89+
})
8190

8291
return
8392
}

0 commit comments

Comments
 (0)