Skip to content

Commit 5355069

Browse files
authored
fix: framework fails to shutdown gracefully when exit code is a string (#545)
1 parent f4371b8 commit 5355069

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/invoker.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ export class ErrorHandler {
100100
sendCrashResponse({err, res: latestRes, callback: killInstance});
101101
});
102102

103-
process.on('exit', code => {
103+
process.on('exit', (code: number | string) => {
104+
if (typeof code === 'string') {
105+
code = parseInt(code);
106+
}
104107
sendCrashResponse({
105108
err: new Error(`Process exited with code ${code}`),
106109
res: latestRes,

0 commit comments

Comments
 (0)