summaryrefslogtreecommitdiff
path: root/doc/api/http2.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api/http2.md')
-rw-r--r--doc/api/http2.md5
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/api/http2.md b/doc/api/http2.md
index 3a131c36a8..354877dba0 100644
--- a/doc/api/http2.md
+++ b/doc/api/http2.md
@@ -271,12 +271,17 @@ server.on('stream', (stream, headers) => {
'content-type': 'text/html',
':status': 200
});
+ stream.on('error', (error) => console.error(error));
stream.end('<h1>Hello World</h1>');
});
server.listen(80);
```
+Even though HTTP/2 streams and network sockets are not in a 1:1 correspondence,
+a network error will destroy each individual stream and must be handled on the
+stream level, as shown above.
+
#### Event: 'timeout'
<!-- YAML
added: v8.4.0