未验证 提交 f7c732fd 编写于 作者: P Paul Annekov 提交者: GitHub

docs: fixed incorrect onerror example (#1459)

上级 143d8f72
......@@ -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());
});
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册