- Node.js Version: 6+
- OS: Any
- Scope (install, code, runtime, meta, other?): runtime
- Module (and version) (if relevant): http
In the example given for http.request on the http doc page, there's no error event listener on the response. Is there any scenario in which an error would be emitted on the response?
var req = http.request(options, (res) => {
res.on('data', (chunk) => { /* ... */ });
res.on('end', () => { /* ... */ });
res.on('error', () => { /* Can this ever happen? */ });
});
req.on('error', /* (can definitely happen) */);
In the example given for
http.requeston the http doc page, there's noerrorevent listener on the response. Is there any scenario in which an error would be emitted on the response?