From 6c856c350f32e8391e53c571085b057da2aa5a67 Mon Sep 17 00:00:00 2001 From: Paul Annekov Date: Tue, 12 May 2020 20:17:53 +0300 Subject: [PATCH] Fixed incorrect example --- docs/api/response.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/response.md b/docs/api/response.md index 4ad2f6631..d7c92ad8d 100644 --- a/docs/api/response.md +++ b/docs/api/response.md @@ -171,7 +171,7 @@ app.use(async (ctx, next) => { const PassThrough = require('stream').PassThrough; app.use(async ctx => { - ctx.body = someHTTPStream.on('error', ctx.onerror).pipe(PassThrough()); + ctx.body = someHTTPStream.on('error', (err) => ctx.onerror(err)).pipe(PassThrough()); }); ```