@@ -648,11 +648,11 @@ describe('retryResponseErrorHandler', () => {
648
648
await retryResponseErrorHandler ( error , config , client ) ;
649
649
fail ( 'Expected retryResponseErrorHandler to throw a custom error' ) ;
650
650
} catch ( customError : any ) {
651
- expect ( customError . status ) . toBe ( 400 ) ;
652
- expect ( customError . statusText ) . toBe ( 'Bad Request' ) ;
653
- expect ( customError . error_message ) . toBe ( 'Invalid request parameters' ) ;
654
- expect ( customError . error_code ) . toBe ( 400 ) ;
655
- expect ( customError . errors ) . toEqual ( [ 'Missing required field: title' ] ) ;
651
+ expect ( customError . response . status ) . toBe ( 400 ) ;
652
+ expect ( customError . response . statusText ) . toBe ( 'Bad Request' ) ;
653
+ expect ( customError . response . data . error_message ) . toBe ( 'Invalid request parameters' ) ;
654
+ expect ( customError . response . data . error_code ) . toBe ( 400 ) ;
655
+ expect ( customError . response . data . errors ) . toEqual ( [ 'Missing required field: title' ] ) ;
656
656
}
657
657
} ) ;
658
658
@@ -677,11 +677,11 @@ describe('retryResponseErrorHandler', () => {
677
677
await retryResponseErrorHandler ( error , config , client ) ;
678
678
fail ( 'Expected retryResponseErrorHandler to throw a custom error' ) ;
679
679
} catch ( customError : any ) {
680
- expect ( customError . status ) . toBe ( 500 ) ;
681
- expect ( customError . statusText ) . toBe ( 'Internal Server Error' ) ;
682
- expect ( customError . error_message ) . toBe ( 'Database connection failed' ) ;
683
- expect ( customError . error_code ) . toBe ( 500 ) ;
684
- expect ( customError . errors ) . toBe ( null ) ;
680
+ expect ( customError . response . status ) . toBe ( 500 ) ;
681
+ expect ( customError . response . statusText ) . toBe ( 'Internal Server Error' ) ;
682
+ expect ( customError . response . data . error_message ) . toBe ( 'Database connection failed' ) ;
683
+ expect ( customError . response . data . error_code ) . toBe ( 500 ) ;
684
+ expect ( customError . response . data . errors ) . toBe ( null ) ;
685
685
}
686
686
} ) ;
687
687
@@ -709,11 +709,11 @@ describe('retryResponseErrorHandler', () => {
709
709
await retryResponseErrorHandler ( error , config , client ) ;
710
710
fail ( 'Expected retryResponseErrorHandler to throw a custom error' ) ;
711
711
} catch ( customError : any ) {
712
- expect ( customError . status ) . toBe ( 422 ) ;
713
- expect ( customError . statusText ) . toBe ( 'Unprocessable Entity' ) ;
714
- expect ( customError . error_message ) . toBe ( 'Validation failed' ) ;
715
- expect ( customError . error_code ) . toBe ( 422 ) ;
716
- expect ( customError . errors ) . toEqual ( {
712
+ expect ( customError . response . status ) . toBe ( 422 ) ;
713
+ expect ( customError . response . statusText ) . toBe ( 'Unprocessable Entity' ) ;
714
+ expect ( customError . response . data . error_message ) . toBe ( 'Validation failed' ) ;
715
+ expect ( customError . response . data . error_code ) . toBe ( 422 ) ;
716
+ expect ( customError . response . data . errors ) . toEqual ( {
717
717
title : [ 'Title is required' ] ,
718
718
content : [ 'Content cannot be empty' ] ,
719
719
} ) ;
0 commit comments