node-http2 icon indicating copy to clipboard operation
node-http2 copied to clipboard

Forward endpoint errors to httpsRequest

Open felicienfrancois opened this issue 8 years ago • 3 comments

Needed to be able to handles thoose errors gracefully because endpoint is not exposed.

felicienfrancois avatar Mar 02 '16 14:03 felicienfrancois

Hrm, so for these, I think I would rather see some logging happen, as well, similar to how we do other errors that we forward on through other objects:

var self = this;
whatever.on('error', function (error) {
  self._log.error('Whatever error: ' + e.toString());
  forwardObject.emit('error', error);
}

Where whatever is the object you're catching errors from, and forwardObject is whatever you're calling emit on in your forwarder (sometimes self, sometimes httpsRequest in your patch).

That way we have symmetry in how we handle errors.

nwgh avatar Apr 22 '16 22:04 nwgh

@nwgh Ok, I just comitted the fix

felicienfrancois avatar Apr 23 '16 07:04 felicienfrancois

just a friendly bump :)

felicienfrancois avatar May 12 '16 09:05 felicienfrancois