diff --git a/doc/api/http2.md b/doc/api/http2.md index 09bce9d144d02a..c008a130915a46 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'); });