Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

实例11中cxt.throw(500)改为 cxt.response.status = 500; app的error事件运行不到,是不是说明这两个方法是不等价的? #7

Closed
dadiu opened this issue Aug 23, 2017 · 1 comment

Comments

@dadiu
Copy link

dadiu commented Aug 23, 2017

实例代码

const main = cxt =>{
    cxt.throw(500);
}

改为

const main = cxt =>{
    cxt.response.status = 500;
}

下面代码运行不到

app.on('error', (err, cxt) =>{
    console.error('server error', err);
});
@ruanyf
Copy link
Owner

ruanyf commented Aug 23, 2017

正常,请参考 Koa 文档。

@ruanyf ruanyf closed this as completed Aug 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants