File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,12 @@ export default async function expressErrorValidation(
1616 logger . error ( `${ msgType } - ${ message } ` )
1717
1818 const errors =
19- err . errors . length > 0
20- ? err . errors . reduce ( ( acc : any , curVal : any ) => {
19+ err . issues . length > 0
20+ ? err . issues . reduce ( ( acc : any , curVal : any ) => {
2121 acc [ `${ curVal . path } ` ] = curVal . message || curVal . type
2222 return acc
2323 } , { } )
24- : { [ `${ err . errors [ 0 ] . path } ` ] : err . errors [ 0 ] . message }
24+ : { [ `${ err . issues [ 0 ] . path } ` ] : err . issues [ 0 ] . message }
2525
2626 const result = {
2727 statusCode : 422 ,
Original file line number Diff line number Diff line change @@ -64,13 +64,13 @@ export class App {
6464 }
6565
6666 public get create ( ) {
67- // @ts -expect- error
67+ // error validation handle
6868 this . _app . use ( expressErrorValidation )
6969
70- // @ts -expect- error
70+ // error sequelize handle
7171 this . _app . use ( expressErrorSequelize )
7272
73- // @ts -expect- error
73+ // error global handle
7474 this . _app . use ( expressErrorHandle )
7575
7676 return this . _app
You can’t perform that action at this time.
0 commit comments