File tree Expand file tree Collapse file tree 3 files changed +190
-257
lines changed Expand file tree Collapse file tree 3 files changed +190
-257
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,9 @@ class API {
5757 const app = new Koa ( ) ;
5858
5959 // listen for error and log events emitted by app
60- app . on ( 'error' , ( err , ctx ) => ctx . logger . error ( err ) ) ;
60+ app . on ( 'error' , ( err , ctx ) => {
61+ ctx . logger [ err . status && err . status < 500 ? 'warn' : 'error' ] ( err ) ;
62+ } ) ;
6163 app . on ( 'log' , logger . log ) ;
6264
6365 // initialize redis
Original file line number Diff line number Diff line change 2929 "cabin" : " ^8.0.2" ,
3030 "express-request-id" : " ^1.4.1" ,
3131 "kcors" : " ^2.2.2" ,
32- "koa" : " ^2.12.1 " ,
32+ "koa" : " ^2.13.0 " ,
3333 "koa-404-handler" : " ^0.0.2" ,
3434 "koa-basic-auth" : " ^4.0.0" ,
3535 "koa-better-error-handler" : " ^4.0.3" ,
4747 "response-time" : " ^2.3.2"
4848 },
4949 "devDependencies" : {
50- "@commitlint/cli" : " ^8.3.5 " ,
51- "@commitlint/config-conventional" : " ^8.3.4 " ,
50+ "@commitlint/cli" : " ^9.0.1 " ,
51+ "@commitlint/config-conventional" : " ^9.0.1 " ,
5252 "ava" : " ^3.9.0" ,
5353 "codecov" : " ^3.7.0" ,
5454 "cross-env" : " ^7.0.2" ,
5555 "eslint" : " 6.x" ,
5656 "eslint-config-xo-lass" : " ^1.0.3" ,
5757 "fixpack" : " ^3.0.6" ,
5858 "husky" : " ^4.2.5" ,
59- "lint-staged" : " 10.2.10 " ,
59+ "lint-staged" : " 10.2.11 " ,
6060 "mongoose" : " ^5.9.19" ,
6161 "nyc" : " ^15.1.0" ,
6262 "remark-cli" : " ^8.0.0" ,
63- "remark-preset-github" : " ^1 .0.1 " ,
63+ "remark-preset-github" : " ^2 .0.0 " ,
6464 "supertest" : " ^4.0.2" ,
6565 "xo" : " 0.25"
6666 },
You can’t perform that action at this time.
0 commit comments