File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ export class HttpService {
21
21
22
22
instance . defaults . transformResponse = ( response : string ) => {
23
23
try {
24
- return JSON . parse ( response ) . data || response ;
24
+ const parsedRes = JSON . parse ( response ) ;
25
+ return parsedRes . data || parsedRes || { } ;
25
26
} catch ( error ) {
26
27
return response ;
27
28
}
@@ -46,8 +47,8 @@ export class HttpService {
46
47
return response ;
47
48
} ,
48
49
// Any status codes that falls outside the range of 2xx cause this function to trigger
49
- ( error : AxiosError ) => {
50
- if ( ( error as any ) ?. errno === ECONNREFUSED * - 1 )
50
+ ( error : AxiosError & { errno ?: number } ) => {
51
+ if ( error ?. errno === ECONNREFUSED * - 1 )
51
52
throw NormalException . HTTP_REQUEST_TIMEOUT ( ) ;
52
53
53
54
if ( error ?. response ?. data ) this . logger . debug ( error . response . data ) ;
You can’t perform that action at this time.
0 commit comments