Skip to content

Commit

Permalink
Log when Facilities cannot find a URL from its breadcrumb rather than…
Browse files Browse the repository at this point in the history
… erroring. (#2417)
  • Loading branch information
timcosgrove authored Jan 31, 2025
1 parent 58bfa40 commit 9f75a69
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/site/stages/build/drupal/health-care-region.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const _ = require('lodash');
const moment = require('moment');
const liquid = require('tinyliquid');
const { logDrupal: log } = require('./utilities-drupal');
const {
createEntityUrlObj,
createFileObj,
Expand Down Expand Up @@ -198,11 +199,11 @@ function addGetUpdatesFields(page, pages) {
!regionPageUrlPath &&
page.entityUrl.breadcrumb[1]?.text !== 'Manila VA Clinic'
) {
throw new Error(
`CMS error while building breadcrumbs: "${page.entityUrl.path}" is missing reference to a parent or grandparent.`,
log(
`WARNING: CMS error while building breadcrumbs: "${page.entityUrl.path}" is missing reference to a parent or grandparent.`,
);
}

// If regionPageUrlPath is empty, this will simply not find a region page, and this function will complete.
const regionPage = pages.find(p => p.entityUrl.path === regionPageUrlPath);

if (regionPage) {
Expand Down

0 comments on commit 9f75a69

Please sign in to comment.