Skip to content

Commit

Permalink
Add some debug code
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Mäder <[email protected]>
  • Loading branch information
tsmaeder committed Dec 31, 2024
1 parent 9f326b5 commit 9dc3853
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/process/src/node/raw-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export class RawProcess extends Process {
});

this.process.on('close', (exitCode, signal) => {
console.log(`raw:exitCode = ${exitCode}, signal =${signal}`);
// node's child_process exit sets the unused parameter to null,
// but we want it to be undefined instead.
this.emitOnClose(
Expand Down
1 change: 1 addition & 0 deletions packages/process/src/node/terminal-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export class TerminalProcess extends Process {
// node-pty actually wait for the underlying streams to be closed before emitting exit.
// We should emulate the `exit` and `close` sequence.
terminal.onExit(({ exitCode, signal }) => {
console.log(`terminal:exitCode = ${exitCode}, signal =${signal}`);
// Make sure to only pass either code or signal as !undefined, not
// both.
//
Expand Down
2 changes: 1 addition & 1 deletion packages/task/src/node/task-server.slow-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ function getExitStatus(taskInfo: TaskInfo, taskWatcher: TaskWatcher): Promise<st
} else if (typeof event.code === 'number') {
resolve(event.code);
} else {
reject(new Error('no code nor signal'));
reject(new Error(`no code nor signal: ${JSON.stringify(event)}`));
}
}
});
Expand Down

0 comments on commit 9dc3853

Please sign in to comment.