fix(pipe): handle 'error' events on pipes to avoid crashing (#4705)
Fix #4374
This commit is contained in:
parent
c9977c8004
commit
f8616ed54b
@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
const {helper} = require('./helper');
|
||||
const {helper, debugError} = require('./helper');
|
||||
|
||||
/**
|
||||
* @implements {!Puppeteer.ConnectionTransport}
|
||||
@ -31,7 +31,9 @@ class PipeTransport {
|
||||
helper.addEventListener(pipeRead, 'close', () => {
|
||||
if (this.onclose)
|
||||
this.onclose.call(null);
|
||||
})
|
||||
}),
|
||||
helper.addEventListener(pipeRead, 'error', debugError),
|
||||
helper.addEventListener(pipeWrite, 'error', debugError),
|
||||
];
|
||||
this.onmessage = null;
|
||||
this.onclose = null;
|
||||
|
Loading…
Reference in New Issue
Block a user