Skip to content

Commit 1c81a05

Browse files
jasnellevanlucas
authored andcommittedJan 30, 2018
doc: update pushStream docs to use err first
Refs: #17406 (comment) PR-URL: #18088 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]>
1 parent 7706e5f commit 1c81a05

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎doc/api/http2.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1174,14 +1174,16 @@ added: v8.4.0
11741174
* Returns: {undefined}
11751175

11761176
Initiates a push stream. The callback is invoked with the new `Http2Stream`
1177-
instance created for the push stream.
1177+
instance created for the push stream passed as the second argument, or an
1178+
`Error` passed as the first argument.
11781179

11791180
```js
11801181
const http2 = require('http2');
11811182
const server = http2.createServer();
11821183
server.on('stream', (stream) => {
11831184
stream.respond({ ':status': 200 });
1184-
stream.pushStream({ ':path': '/' }, (pushStream) => {
1185+
stream.pushStream({ ':path': '/' }, (err, pushStream) => {
1186+
if (err) throw err;
11851187
pushStream.respond({ ':status': 200 });
11861188
pushStream.end('some pushed data');
11871189
});

0 commit comments

Comments
 (0)
Please sign in to comment.