Skip to content

http2 - compat request forward error #15359

Closed
@ronag

Description

@ronag

After thinking about this for a while I think we still should forward error events from the stream object. However, only if there is an event listener as to avoid uncaught errors.

function onStreamError(error) {
  const request = this[kRequest];
  if (request.hasListener('error')) {
    request.emit('error', error);
  }
}

Otherwise we end up with hacks like this:

 const incoming = req.stream || req
 incoming.on('error', errorHandler)

Metadata

Metadata

Assignees

No one assigned

    Labels

    http2Issues or PRs related to the http2 subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions