Skip to content

Commit

Permalink
docs: add one more reason why not use koa 2
Browse files Browse the repository at this point in the history
  • Loading branch information
dead-horse committed Jan 8, 2017
1 parent 38aec42 commit 9850fe8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
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。

0 comments on commit 9850fe8

Please sign in to comment.