Skip to content

doc: clarify IncomingMessage.destroy() description

Rodrigo Muino Tomonari requested to merge github/fork/XMB5/message-clarify into master

State that the 'error' event is emitted on the underlying socket, not the IncomingMessage object.

Here are the relevant parts in the code:

Here's a program that demonstrates this

http.createServer(req=>{
  req.on('error',console.error);
  req.destroy(new Error('hi'));
}).listen(8080)

Then, curl localhost:8080 The Node.js process doesn't print the error

Checklist

Merge request reports

Loading