Skip to content

Commit b1690f7

Browse files
authored
Merge pull request #222 from AthennaIO/develop
chore(kernel): delete stack if not in debug mode
2 parents c2dcdc2 + 0ca9634 commit b1690f7

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-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.36.0",
3+
"version": "5.37.0",
44
"description": "The Athenna Http server. Built on top of fastify.",
55
"license": "MIT",
66
"author": "João Lenon <lenon@athenna.io>",

src/handlers/HttpExceptionHandler.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,13 @@ export class HttpExceptionHandler {
5757
body.name = 'InternalServerException'
5858
body.message = 'An internal server exception has occurred.'
5959

60-
delete body.stack
6160
delete body.details
6261
}
6362

63+
if (!isDebugMode) {
64+
delete body.stack
65+
}
66+
6467
response.status(body.statusCode).send(body)
6568

6669
if (!this.canBeLogged(error)) {

0 commit comments

Comments
 (0)