Skip to content

Commit

Permalink
fix: show errors found in IndexConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
dominique-pfister committed Sep 26, 2024
1 parent 7ef77c3 commit d570e9a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"dependencies": {
"@adobe/fetch": "4.1.9",
"@adobe/helix-log": "6.0.4",
"@adobe/helix-shared-config": "11.0.0",
"@adobe/helix-shared-config": "11.0.1",
"@adobe/helix-shared-git": "3.0.14",
"@adobe/helix-shared-indexer": "2.1.5",
"camelcase": "8.0.0",
Expand Down
7 changes: 7 additions & 0 deletions src/server/Indexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,15 @@ export default class Indexer {
.withDirectory(this._cwd)
.withLogger(log)
.init();
const errors = this._index.getErrors();
if (errors.length) {
const detail = errors.map(({ message }) => (message)).join('\n');
throw new Error(`
${detail}`);
}
} catch (e) {
log.error(`Error in helix-query.yaml: ${e.message}`);
return;
}
if (this._printIndex && this._index.indices.length === 0) {
log.warn(chalk`AEM CLI started with {gray --print-index} but no valid {gray helix-query.yaml} found.`);
Expand Down

0 comments on commit d570e9a

Please sign in to comment.