Skip to content

Commit

Permalink
docs: fixed incorrect onerror example (#1459)
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulAnnekov committed May 16, 2020
1 parent 143d8f7 commit f7c732f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/api/response.md
Expand Up @@ -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());
});
```

Expand Down

0 comments on commit f7c732f

Please sign in to comment.