Skip to content

http2 - compat request forward errorΒ #15359

@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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions