开源软件名称:ladjs/koa-better-error-handler
开源软件地址:https://github.com/ladjs/koa-better-error-handler
开源编程语言:
JavaScript
84.4%
开源软件介绍:koa-better-error-handler
A better error-handler for Lad and Koa. Makes ctx.throw awesome (best used with koa-404-handler)
Index
Features
- Detects Node.js DNS errors (e.g.
ETIMEOUT and EBADFAMILY ) and sends 408 Client Timeout error
- Detects Redis errors (e.g. ioredis' MaxRetriesPerRequestError) and sends 408 Client Timeout error
- Uses Boom for making error messages beautiful (see User Friendly Responses below)
- Simply a better error handler (doesn't remove all headers like the built-in one does)
- Doesn't make all status codes 500 (like the built-in Koa error handler does)
- Supports Flash messages and preservation of newly set session object
- Fixes annoying redirect issue where flash messages were lost upon an error being thrown
- Supports HTML Error Lists using
<ul> for Mongoose validation errors with more than one message
- Makes
ctx.throw beautiful messages (e.g. ctx.throw(404) will output a beautiful error object |
请发表评论