@athenna/http 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -29,13 +29,13 @@ class HttpErrorHandler {
|
|
|
29
29
|
body.error.help = error.help;
|
|
30
30
|
}
|
|
31
31
|
const isInternalServerError = statusCode === 500;
|
|
32
|
-
const isDebugMode =
|
|
32
|
+
const isDebugMode = config_1.Config.get('app.debug');
|
|
33
33
|
if (isInternalServerError && !isDebugMode) {
|
|
34
34
|
body.error.name = 'Internal server error';
|
|
35
35
|
body.error.message = 'An internal server exception has occurred.';
|
|
36
36
|
delete body.error.stack;
|
|
37
37
|
}
|
|
38
|
-
if (
|
|
38
|
+
if (isDebugMode) {
|
|
39
39
|
new logger_1.Logger().error(`Error: ${JSON.stringify(body.error, null, 2)}`, {
|
|
40
40
|
formatterConfig: {
|
|
41
41
|
context: HttpErrorHandler.name,
|