summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2018-01-10 09:48:21 -0800
committerJames M Snell <jasnell@gmail.com>2018-01-11 10:14:14 -0800
commit078b7a2a65599ac6bc7e16e18de482556259d0db (patch)
tree6a9f527486a275df9eab5161ebf2e961cf2c3a37 /doc
parent7c84f19455a29c4c132935aacc3ce1628fc38ac3 (diff)
downloadandroid-node-v8-078b7a2a65599ac6bc7e16e18de482556259d0db.tar.gz
android-node-v8-078b7a2a65599ac6bc7e16e18de482556259d0db.tar.bz2
android-node-v8-078b7a2a65599ac6bc7e16e18de482556259d0db.zip
doc: update pushStream docs to use err first
Refs: https://github.com/nodejs/node/pull/17406#issuecomment-356661798 PR-URL: https://github.com/nodejs/node/pull/18088 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/http2.md6
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/api/http2.md b/doc/api/http2.md
index 09bce9d144..c008a13091 100644
--- a/doc/api/http2.md
+++ b/doc/api/http2.md
@@ -1174,14 +1174,16 @@ added: v8.4.0
* Returns: {undefined}
Initiates a push stream. The callback is invoked with the new `Http2Stream`
-instance created for the push stream.
+instance created for the push stream passed as the second argument, or an
+`Error` passed as the first argument.
```js
const http2 = require('http2');
const server = http2.createServer();
server.on('stream', (stream) => {
stream.respond({ ':status': 200 });
- stream.pushStream({ ':path': '/' }, (pushStream) => {
+ stream.pushStream({ ':path': '/' }, (err, pushStream) => {
+ if (err) throw err;
pushStream.respond({ ':status': 200 });
pushStream.end('some pushed data');
});