Skip to content

Commit

Permalink
chore: add error text coloring for better readability
Browse files Browse the repository at this point in the history
  • Loading branch information
AnimeshKumar923 committed Jun 19, 2024
1 parent e2cc95a commit 742a2a2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions scripts/validation/embedded-examples-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,21 +134,20 @@ async function validateParser(document, name) {
if (diagnostics.length > 0) {
diagnostics.forEach(diagnostic => {
if (diagnostic.level === 'error') {
console.error(`Error in ${name}: ${diagnostic.message}`);
// process.exit(1);
console.error(`\x1b[31mError in ${name}: ${diagnostic.message}\x1b[0m`);
} else {
console.log(`Warning in ${name}: ${diagnostic.message}`);
console.log(`\x1b[31mWarning in ${name}: ${diagnostic.message}\x1b[0m`);
}
});
} else {
console.log(`${name} is valid.`);
}
} catch (error) {
console.error(`Validation failed for ${name}: ${error.message}`);
// process.exit(1);
console.error(`\x1b[31mValidation failed for ${name}: ${error.message}\x1b[0m`);
}
}


// Iterate over the combinedData array, apply updates, and validate each document
const baseDocPath = './base-doc.json';
const baseDocSecuritySchemePath = './base-doc-security-scheme-object.json';
Expand Down

0 comments on commit 742a2a2

Please sign in to comment.