@@ -3,7 +3,7 @@ import { AxiosError } from 'axios'
3
3
import { remove } from 'lodash'
4
4
import { apiService , localStorageService } from 'uiSrc/services'
5
5
import { ApiEndpoints , BrowserStorageItem , Pages } from 'uiSrc/constants'
6
- import { getApiErrorMessage , isStatusSuccessful , Nullable } from 'uiSrc/utils'
6
+ import { getApiErrorMessage , getAxiosError , isStatusSuccessful , Nullable } from 'uiSrc/utils'
7
7
8
8
import { CloudJobName , CloudJobStatus } from 'uiSrc/electron/constants'
9
9
import {
@@ -16,7 +16,14 @@ import { CloudJobInfo } from 'apiSrc/modules/cloud/job/models'
16
16
import { CloudSubscriptionPlanResponse } from 'apiSrc/modules/cloud/subscription/dto'
17
17
18
18
import { AppDispatch , RootState } from '../store'
19
- import { CloudCapiKey , CloudJobInfoState , Instance , OAuthSocialSource , StateAppOAuth } from '../interfaces'
19
+ import {
20
+ CloudCapiKey ,
21
+ CloudJobInfoState ,
22
+ EnhancedAxiosError ,
23
+ Instance ,
24
+ OAuthSocialSource ,
25
+ StateAppOAuth
26
+ } from '../interfaces'
20
27
import {
21
28
addErrorNotification ,
22
29
addInfiniteNotification ,
@@ -361,9 +368,10 @@ export function fetchPlans(onSuccessAction?: () => void, onFailAction?: () => vo
361
368
362
369
onSuccessAction ?.( )
363
370
}
364
- } catch ( _err ) {
365
- const error = _err as AxiosError
366
- dispatch ( addErrorNotification ( error ) )
371
+ } catch ( error ) {
372
+ const err = getAxiosError ( error as EnhancedAxiosError )
373
+
374
+ dispatch ( addErrorNotification ( err ) )
367
375
dispatch ( getPlansFailure ( ) )
368
376
dispatch ( removeInfiniteNotification ( InfiniteMessagesIds . oAuthProgress ) )
369
377
onFailAction ?.( )
0 commit comments