We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 143d8f7 commit f7c732fCopy full SHA for f7c732f
1 file changed
docs/api/response.md
@@ -171,7 +171,7 @@ app.use(async (ctx, next) => {
171
const PassThrough = require('stream').PassThrough;
172
173
app.use(async ctx => {
174
- ctx.body = someHTTPStream.on('error', ctx.onerror).pipe(PassThrough());
+ ctx.body = someHTTPStream.on('error', (err) => ctx.onerror(err)).pipe(PassThrough());
175
});
176
```
177
0 commit comments