File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -12,12 +12,11 @@ export const throwAndDelegateError = (
12
12
apiKey : string | undefined ,
13
13
logMessage ?: string
14
14
) => {
15
- const errorMessage =
16
- error instanceof AxiosError
17
- ? error . response ?. data
18
- ? JSON . stringify ( error . response ?. data )
19
- : error . message
20
- : error . message ;
15
+ const errorMessage = axios . isAxiosError ( error )
16
+ ? error . response ?. data
17
+ ? JSON . stringify ( error . response ?. data )
18
+ : error . message
19
+ : error . message ;
21
20
22
21
if ( logMessage ) {
23
22
errorLogger ( source , logMessage , apiKey , errorMessage ) ;
@@ -43,12 +42,9 @@ export const throwAndDelegateError = (
43
42
errorType = IntegrationErrorType . INTEGRATION_ERROR_UNAVAILABLE ;
44
43
break ;
45
44
default :
46
- console . log ( "bin default weil status= " , status ) ;
47
45
throw new ServerError ( status , `${ source } (${ errorMessage } )` ) ;
48
46
}
49
- console . log ( "bin außerhalb vom switch weil status= " , status ) ;
50
47
throw new ServerError ( DELEGATE_TO_FRONTEND_CODE , errorType ) ;
51
48
}
52
- console . log ( "kein axios" ) ;
53
49
throw new ServerError ( 500 , "An internal error occurred" ) ;
54
50
} ;
You can’t perform that action at this time.
0 commit comments