Skip to content

Commit 157c82b

Browse files
committed
error message tweaks for clarity
1 parent 76650e4 commit 157c82b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/get-applicable-versions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function getApplicableVersions(frontmatterVersions, filepath) {
7373
!foundFeatureVersions.isNextVersionOnly
7474
) {
7575
throw new Error(
76-
`No applicable versions found for ${filepath}. Please double-check the page's \`versions\` frontmatter.`
76+
`${filepath} is not available in any currently supported version. Make sure the \`versions\` property includes at least one supported version.`
7777
)
7878
}
7979

middleware/contextualizers/features.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default function features(req, res, next) {
66
// Determine whether the currentVersion belongs to the list of versions the feature is available in.
77
Object.keys(req.context.site.data.features).forEach((featureName) => {
88
const { versions } = req.context.site.data.features[featureName]
9-
const applicableVersions = getApplicableVersions(versions, req.path)
9+
const applicableVersions = getApplicableVersions(versions, `data/features/${featureName}.yml`)
1010

1111
// Adding the resulting boolean to the context object gives us the ability to use
1212
// `{% if featureName ... %}` conditionals in content files.

0 commit comments

Comments
 (0)