File tree Expand file tree Collapse file tree 2 files changed +1
-16
lines changed Expand file tree Collapse file tree 2 files changed +1
-16
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ class FormatError {
2828 const error = this . errorType [ err . message ]
2929
3030 if ( ! error ) {
31- throw new Error ( ` ${ err . message } error is not defined on easygraphql-formatError` )
31+ return err
3232 }
3333
3434 return error
Original file line number Diff line number Diff line change @@ -56,20 +56,5 @@ describe('Get Errors with message and code', () => {
5656 expect ( error . statusCode ) . to . be . eq ( 400 )
5757 }
5858 } )
59-
60- it ( 'Should get Invalid email format error with the statusCode' , async ( ) => {
61- let error
62- try {
63- formatError . getError ( { message : 'Invalid email' } )
64- } catch ( err ) {
65- error = err
66- }
67-
68- if ( ! error ) {
69- throw new Error ( 'There should be an error' )
70- }
71-
72- expect ( error . message ) . to . be . eq ( 'Invalid email error is not defined on easygraphql-formatError' )
73- } )
7459 } )
7560} )
You can’t perform that action at this time.
0 commit comments