From 5ad9410212a1d165c9b7fe6592f2d69fb947c952 Mon Sep 17 00:00:00 2001 From: Stephen Daly Date: Tue, 20 Feb 2024 10:51:27 +0000 Subject: [PATCH] BAU Log error message when rendering error page If we catch an error and render the error page, we do not currently log the error message. The `error` always evaluates as an empty JSON object when we attempt to log it so it is not included. Instead, log the error message. --- app/utils/response-router.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/utils/response-router.js b/app/utils/response-router.js index b3c081e46..80d8f5d4d 100644 --- a/app/utils/response-router.js +++ b/app/utils/response-router.js @@ -274,7 +274,7 @@ function logErrorPageShown (page, reason, loggingFields, error) { logger.info('Rendering error response', { page, reason, - error, + error: error && error.message, ...loggingFields }) }