Skip to content

Commit

Permalink
Prefix error message with red "error"
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Apr 14, 2024
1 parent 9d02200 commit 2d2f0c5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/knip/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ const run = async () => {
process.exitCode = 2;
if (!isDebug && error instanceof Error && isKnownError(error)) {
const knownError = getKnownError(error);
console.error(knownError.message);
const prefix = `${picocolors.red('ERROR:')}`;
console.error(`${prefix} ${knownError.message}`);
if (hasCause(knownError)) console.error('Reason:', knownError.cause.message);
if (isConfigurationError(knownError)) console.log(`\n${helpText}`);
process.exit(2);
Expand Down

0 comments on commit 2d2f0c5

Please sign in to comment.