Skip to content

Commit

Permalink
fix: framework fails to shutdown gracefully when exit code is a string
Browse files Browse the repository at this point in the history
  • Loading branch information
garethgeorge committed Jul 6, 2023
1 parent dd97f7e commit 9384474
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/invoker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ export class ErrorHandler {
sendCrashResponse({err, res: latestRes, callback: killInstance});
});

process.on('exit', code => {
process.on('exit', (code: number | string) => {
if (typeof code === 'string') {
code = parseInt(code);
}
sendCrashResponse({
err: new Error(`Process exited with code ${code}`),
res: latestRes,
Expand Down

0 comments on commit 9384474

Please sign in to comment.