Skip to content

Commit

Permalink
fix: CLI should not exit cleanly on unexpected error
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit0 committed Jan 1, 2021
1 parent 089ffbc commit 2907328
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bin/typedoc
Expand Up @@ -9,6 +9,7 @@ const ExitCodes = {
NoEntryPoints: 2,
CompileError: 3,
OutputError: 4,
ExceptionThrown: 5,
};

const td = require("..");
Expand All @@ -24,11 +25,12 @@ app.options.addReader(new td.ArgumentsReader(300));
app.bootstrap();

run(app)
.then(process.exit)
.catch((error) => {
console.error("TypeDoc exiting with unexpected error:");
console.error(error);
});
return ExitCodes.ExceptionThrown;
})
.then(process.exit);

/** @param {td.Application} app */
async function run(app) {
Expand Down

0 comments on commit 2907328

Please sign in to comment.