Skip to content

Commit

Permalink
fix: applied suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
AnimeshKumar923 committed Jul 5, 2024
1 parent 2c3c55b commit 34e00e0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/validation/embedded-examples-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,14 @@ async function validateParser(document, name) {

if (diagnostics.length > 0) {
diagnostics.forEach(diagnostic => {
const errorMessage = `\x1b[31mError in ${name}: ${diagnostic.message}\x1b[0m`
console.log(errorMessage);
process.exit(1);
const errorMessage = `\x1b[31mError in ${name}: ${diagnostic.message}\x1b[0m`;
if (diagnostic.level === 'error') {
console.error(errorMessage);
process.exit(1);
} else {
console.log(errorMessage);
process.exit(1);
}
});
} else {
console.log(`${name} is valid.`);
Expand Down

0 comments on commit 34e00e0

Please sign in to comment.