Skip to content

Commit 2907328

Browse files
committed
fix: CLI should not exit cleanly on unexpected error
1 parent 089ffbc commit 2907328

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bin/typedoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const ExitCodes = {
99
NoEntryPoints: 2,
1010
CompileError: 3,
1111
OutputError: 4,
12+
ExceptionThrown: 5,
1213
};
1314

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

2627
run(app)
27-
.then(process.exit)
2828
.catch((error) => {
2929
console.error("TypeDoc exiting with unexpected error:");
3030
console.error(error);
31-
});
31+
return ExitCodes.ExceptionThrown;
32+
})
33+
.then(process.exit);
3234

3335
/** @param {td.Application} app */
3436
async function run(app) {

0 commit comments

Comments
 (0)