Skip to content

Commit ede4c32

Browse files
committed
Catch & report failed spawning of terminal processes
1 parent bb36fa0 commit ede4c32

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/interceptors/fresh-terminal.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,14 @@ export class TerminalInterceptor implements Interceptor {
116116

117117
terminals[proxyPort] = (terminals[proxyPort] || []).concat(childProc);
118118

119-
childProc.once('exit', () => {
119+
120+
const onTerminalClosed = () => {
120121
terminals[proxyPort] = _.reject(terminals[proxyPort], childProc);
122+
};
123+
childProc.once('exit', onTerminalClosed);
124+
childProc.once('error', (e) => {
125+
reportError(e);
126+
onTerminalClosed();
121127
});
122128
}
123129

0 commit comments

Comments
 (0)