cdp: handle stdio sending when closed
This commit is contained in:
parent
1a74923cff
commit
efff1770e5
@ -121,8 +121,12 @@ export default async ({ pipe: { pipeWrite, pipeRead } = {}, port }) => {
|
||||
pipeRead.on('close', () => log('pipe read closed'));
|
||||
|
||||
_send = data => {
|
||||
pipeWrite.write(data);
|
||||
pipeWrite.write('\0');
|
||||
if (closed) return new Error('CDP connection closed');
|
||||
|
||||
try {
|
||||
pipeWrite.write(data);
|
||||
pipeWrite.write('\0');
|
||||
} catch { } // error writing, likely closed/closing (cannot check)
|
||||
};
|
||||
|
||||
_close = () => {};
|
||||
|
Loading…
x
Reference in New Issue
Block a user