Skip to content

Commit

Permalink
fix(pipe): handle 'error' events on pipes to avoid crashing (#4705)
Browse files Browse the repository at this point in the history
Fix #4374
  • Loading branch information
aslushnikov committed Jul 16, 2019
1 parent c9977c8 commit f8616ed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/PipeTransport.js
Expand Up @@ -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}
Expand All @@ -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;
Expand Down

0 comments on commit f8616ed

Please sign in to comment.