diff options
author | Rich Trott <rtrott@gmail.com> | 2017-08-26 12:28:07 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2017-08-26 13:13:17 -0700 |
commit | f912080bf2d8fd024d3443f3ab9e399bc84a724b (patch) | |
tree | 3e7788b04811297547de8edb4ea2c88f7352b7f9 /doc | |
parent | 99c478eb3629292e625a4d2fd634e89f0120ab91 (diff) | |
download | android-node-v8-f912080bf2d8fd024d3443f3ab9e399bc84a724b.tar.gz android-node-v8-f912080bf2d8fd024d3443f3ab9e399bc84a724b.tar.bz2 android-node-v8-f912080bf2d8fd024d3443f3ab9e399bc84a724b.zip |
Revert "http2: refactor error handling"
This reverts commit 4ca8ff264f368c301827e07956f313cebd1b8de8.
That commit was landed without a green CI and is failing on Windows.
PR-URL: https://github.com/nodejs/node/pull/15047
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc')
-rwxr-xr-x | doc/api/http2.md | 39 |
1 files changed, 4 insertions, 35 deletions
diff --git a/doc/api/http2.md b/doc/api/http2.md index 57e1b74e7e..d9b8aa97b0 100755 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -1118,8 +1118,6 @@ added: v8.4.0 * `headers` {[Headers Object][]} * `options` {Object} * `statCheck` {Function} - * `onError` {Function} Callback function invoked in the case of an - Error before send * `getTrailers` {Function} Callback function invoked to collect trailer headers. * `offset` {number} The offset position at which to begin reading @@ -1148,16 +1146,6 @@ server.on('stream', (stream) => { function statCheck(stat, headers) { headers['last-modified'] = stat.mtime.toUTCString(); } - - function onError(err) { - if (err.code === 'ENOENT') { - stream.respond({ ':status': 404 }); - } else { - stream.respond({ ':status': 500 }); - } - stream.end(); - } - stream.respondWithFile('/some/file', { 'content-type': 'text/plain' }, { statCheck }); @@ -1190,10 +1178,6 @@ The `offset` and `length` options may be used to limit the response to a specific range subset. This can be used, for instance, to support HTTP Range requests. -The `options.onError` function may also be used to handle all the errors -that could happen before the delivery of the file is initiated. The -default behavior is to destroy the stream. - When set, the `options.getTrailers()` function is called immediately after queuing the last chunk of payload data to be sent. The callback is passed a single object (with a `null` prototype) that the listener may used to specify @@ -1224,19 +1208,6 @@ added: v8.4.0 * Extends: {net.Server} -In `Http2Server`, there is no `'clientError'` event as there is in -HTTP1. However, there are `'socketError'`, `'sessionError'`, and -`'streamError'`, for error happened on the socket, session or stream -respectively. - -#### Event: 'socketError' -<!-- YAML -added: v8.4.0 ---> - -The `'socketError'` event is emitted when a `'socketError'` event is emitted by -an `Http2Session` associated with the server. - #### Event: 'sessionError' <!-- YAML added: v8.4.0 @@ -1246,15 +1217,13 @@ The `'sessionError'` event is emitted when an `'error'` event is emitted by an `Http2Session` object. If no listener is registered for this event, an `'error'` event is emitted. -#### Event: 'streamError' +#### Event: 'socketError' <!-- YAML -added: REPLACEME +added: v8.4.0 --> -* `socket` {http2.ServerHttp2Stream} - -If an `ServerHttp2Stream` emits an `'error'` event, it will be forwarded here. -The stream will already be destroyed when this event is triggered. +The `'socketError'` event is emitted when a `'socketError'` event is emitted by +an `Http2Session` associated with the server. #### Event: 'stream' <!-- YAML |