Skip to content

Commit 1d29541

Browse files
committed
Log when Facilities cannot find a URL from its breadcrumb rather than erroring.
1 parent d3fadcd commit 1d29541

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/site/stages/build/drupal/health-care-region.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
const _ = require('lodash');
44
const moment = require('moment');
55
const liquid = require('tinyliquid');
6+
const { logDrupal: log } = require('./utilities-drupal');
67
const {
78
createEntityUrlObj,
89
createFileObj,
@@ -198,11 +199,11 @@ function addGetUpdatesFields(page, pages) {
198199
!regionPageUrlPath &&
199200
page.entityUrl.breadcrumb[1]?.text !== 'Manila VA Clinic'
200201
) {
201-
throw new Error(
202-
`CMS error while building breadcrumbs: "${page.entityUrl.path}" is missing reference to a parent or grandparent.`,
202+
log(
203+
`WARNING: CMS error while building breadcrumbs: "${page.entityUrl.path}" is missing reference to a parent or grandparent.`,
203204
);
204205
}
205-
206+
// If regionPageUrlPath is empty, this will simply not find a region page, and this function will complete.
206207
const regionPage = pages.find(p => p.entityUrl.path === regionPageUrlPath);
207208

208209
if (regionPage) {

0 commit comments

Comments
 (0)