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'));
|
pipeRead.on('close', () => log('pipe read closed'));
|
||||||
|
|
||||||
_send = data => {
|
_send = data => {
|
||||||
|
if (closed) return new Error('CDP connection closed');
|
||||||
|
|
||||||
|
try {
|
||||||
pipeWrite.write(data);
|
pipeWrite.write(data);
|
||||||
pipeWrite.write('\0');
|
pipeWrite.write('\0');
|
||||||
|
} catch { } // error writing, likely closed/closing (cannot check)
|
||||||
};
|
};
|
||||||
|
|
||||||
_close = () => {};
|
_close = () => {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user