think_error
1.1.5 • Public • Published 介绍
![Dependency Status](https://camo.githubusercontent.com/283bc882d6b3e4b7c4675eebfb1cc7129342f8fe02bd92f1a460a627a6357dab/68747470733a2f2f64617669642d646d2e6f72672f7468696e6b6b6f612f7468696e6b5f6572726f722e737667)
Error catch for ThinkKoa.
安装
npm i think_error
使用
1、error中间件为thinkkoa内置中间件,无需在项目中创建引用。该中间件默认开启
2、项目中间件配置 config/middleware.js:
config: { //中间件配置
...,
error: {
timeout: 30, //http请求超时时间,单位s
error_code: 500, //报错时的状态码
error_no_key: 'errno', //错误号的key
error_msg_key: 'errmsg', //错误消息的key
}
}
/think_error/
//
Package Sidebar
Install
Weekly Downloads