UNPKG
@limejs/core
Version:
beta (0.4.0)
latest (0.4.5)
next (1.0.0-next)
1.0.0-next
0.4.5
0.4.4
0.4.3
0.4.1
0.4.0
0.3.0
0.2.0
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
0.0.5
0.0.4
0.0.2
0.0.1
lime framework
github.com/limejs/lime
limejs/lime
@limejs/core
/
doc
/
error.md
10 lines
(6 loc)
•
331 B
Markdown
View Raw
1
2
3
4
5
6
7
8
9
10
## 错误和异常处理
如果要在 controller 中抛出一个异常,可以使用
this
.
throw
() 来抛出,函数原型为: ```js ctx.
throw
([status], [msg], [properties])
// (基于http-errors进行错误包装)
``` 为了避免异常逃逸,请不要在controller中再次使用其他异步函数如 setTimeout 等。