Skip to content

Commit

Permalink
Hide stack trace when throwing exception (#344)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmish committed Dec 13, 2022
1 parent 355d0fc commit 259f9ae
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions bin/eslint-doc-generator.ts
Expand Up @@ -4,11 +4,10 @@
import { run } from '../lib/cli.js';
import { generate } from '../lib/generator.js';

try {
run(process.argv, (path, options) => generate(path, options));
} catch (error) {
// eslint-disable-next-line unicorn/prefer-top-level-await -- TODO: use top-level await once updating TypeScript target to ES2022 (when dropping Node 14 support).
run(process.argv, (path, options) => generate(path, options)).catch((error) => {
if (error instanceof Error) {
console.error(error.message);
}
process.exitCode = 1;
}
});

0 comments on commit 259f9ae

Please sign in to comment.