think_error

1.1.5 • Public • Published

介绍


npm version Dependency Status

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
    }
}

Readme

Keywords

none

Package Sidebar

Install

npm i think_error

Weekly Downloads

0

Version

1.1.5

License

MIT

Last publish

Collaborators

  • richenlin