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

docs: add one more reason why not use koa 2 #206

Merged
merged 1 commit into from Jan 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/zh-cn/core/error-handling.md
Expand Up @@ -52,7 +52,7 @@ this.runInBackground(function* () {

框架通过 [onerror](https://github.com/eggjs/egg-onerror) 插件提供了统一的错误处理机制。对一个请求的所有处理方法(middleware、controller、service)中抛出的任何异常都会被它捕获,并自动根据请求想要获取的类型返回不同类型的错误(基于 [Content Negotiation](https://tools.ietf.org/html/rfc7231#section-5.3.2))。

| 请求需求的格式 | 环境 | errorPageUrl 是否配置 | 返回内容 |
| 请求需求的格式 | 环境 | errorPageUrl 是否配置 | 返回内容 |
|-------------|------|----------------------|--------|
| html & text | local & unittest | - | onerror 自带的错误页面,展示详细的错误信息 |
| html & text | 其他 | 是 | 重定向到 errorPageUrl |
Expand Down
1 change: 1 addition & 0 deletions docs/source/zh-cn/intro/egg-and-koa.md
Expand Up @@ -184,5 +184,6 @@ exports.handler = function*() {

1. 服务端代码需要足够的稳定,并且出现故障时可以最快的定位到问题,所以尽量不要让编译后的后端代码运行在生产环境。
1. node 6 对 ECMAScript 2015 的支持已经达到了 [99%](http://node.green/),绝大多数的语法已经不需要 babel 也能够使用了。
1. 基于 co + generator 的开发体验和 async await 没有区别,而且本质上它们就是同一个东西。当真的要做代码迁移的时候基本通过简单的替换就能完成。

当然,当 node 8 发布,async await 在 LTS 版本上处于默认可用状态的时候,koa 2 会发布正式版,egg 也会在那个时候升级到 koa 2。