Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
doc: fix mistake in http2stream.respondWithFile.
http2stream.respondWithFile api has changed since 8.5.0 with the
addition of the onError option. In the first code example an
onError function is implemented but never used, fix this
mistake.

Add a description to have more informations when onError is triggered.

Fixes: #15390
  • Loading branch information
antoine-amara committed Sep 26, 2017
commit 42c244d2f9b212b681865483a8489a3219346244
5 changes: 3 additions & 2 deletions doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,8 @@ of the given file:

If an error occurs while attempting to read the file data, the `Http2Stream`
will be closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR`
code.
code. If the `onError` callback is defined it will be called, otherwise
the stream will be destroyed.

Example using a file path:

Expand All @@ -1170,7 +1171,7 @@ server.on('stream', (stream) => {

stream.respondWithFile('/some/file',
{ 'content-type': 'text/plain' },
{ statCheck });
{ statCheck, onError });
});
```

Expand Down