diff --git a/package-lock.json b/package-lock.json index 6fb12d2..8242063 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@athenna/http", - "version": "5.36.0", + "version": "5.37.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@athenna/http", - "version": "5.36.0", + "version": "5.37.0", "license": "MIT", "devDependencies": { "@athenna/artisan": "^5.7.0", diff --git a/package.json b/package.json index 9aa149e..021a40b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@athenna/http", - "version": "5.36.0", + "version": "5.37.0", "description": "The Athenna Http server. Built on top of fastify.", "license": "MIT", "author": "João Lenon ", diff --git a/src/handlers/HttpExceptionHandler.ts b/src/handlers/HttpExceptionHandler.ts index 516e260..1aa1139 100644 --- a/src/handlers/HttpExceptionHandler.ts +++ b/src/handlers/HttpExceptionHandler.ts @@ -57,10 +57,13 @@ export class HttpExceptionHandler { body.name = 'InternalServerException' body.message = 'An internal server exception has occurred.' - delete body.stack delete body.details } + if (!isDebugMode) { + delete body.stack + } + response.status(body.statusCode).send(body) if (!this.canBeLogged(error)) {