File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 7
7
import { errorLogger } from "./logger.util" ;
8
8
9
9
export const throwAndDelegateError = (
10
- error : AxiosError | Error ,
10
+ error : AxiosError | ServerError | Error ,
11
11
source : string ,
12
12
apiKey : string | undefined ,
13
13
logMessage ?: string
@@ -23,9 +23,12 @@ export const throwAndDelegateError = (
23
23
} else {
24
24
errorLogger ( source , errorMessage , apiKey ) ;
25
25
}
26
- if ( axios . isAxiosError ( error ) ) {
26
+
27
+ const err = error as any ;
28
+ if ( err . code || err . response ?. status ) {
27
29
const status =
28
- error . response ?. status || ( error . code ? parseInt ( error . code ) : 500 ) ;
30
+ err . response ?. status || ( err . code ? parseInt ( err . code ) : 500 ) ;
31
+
29
32
var errorType : IntegrationErrorType ;
30
33
switch ( status ) {
31
34
case 401 :
You can’t perform that action at this time.
0 commit comments