diff --git a/CHANGELOG.md b/CHANGELOG.md index e0121ccb..c61a285b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Remove guidance and tutorials - these can now be found online on the [NHS Prototype Kit website](https://prototype-kit.service-manual.nhs.uk) - ([PR 385](https://github.com/nhsuk/nhsuk-prototype-kit/pull/385)) - Update NHS frontend to 9.1.0 +- Show errors when session data defaults crashes ([PR 402](https://github.com/nhsuk/nhsuk-prototype-kit/pull/402)) ## 5.0.0 - 15 October 2024 diff --git a/lib/utils.js b/lib/utils.js index a3244900..ad3e6346 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -248,8 +248,9 @@ const sessionDataDefaultsFile = path.join(__dirname, '../app/data/session-data-d try { /* eslint-disable-next-line */ sessionDataDefaults = require(sessionDataDefaultsFile); -} catch (e) { +} catch (error) { console.error('Could not load the session data defaults from app/data/session-data-defaults.js. Might be a syntax error?'); // eslint-disable-line no-console + console.error(error) } // Middleware - store any data sent in session, and pass it to all views