Skip to content

Commit 1668a0f

Browse files
committed
fix: add catch blocks to fetch calls
Changes in appDetails/AppDetails.tsx, details/main.tsx & appDetails/AppDetails.component.tsx
1 parent 7edbb54 commit 1668a0f

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

src/components/app/details/appDetails/AppDetails.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,9 @@ export const Details: React.FC<DetailsType> = ({
333333
}
334334
},
335335
)
336-
.catch(noop)
336+
.catch((error) => {
337+
showError(error)
338+
})
337339
},
338340
[
339341
params.appId,

src/components/app/details/main.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
ToastBody,
99
DeleteDialog,
1010
ErrorScreenManager,
11-
noop,
1211
} from '@devtron-labs/devtron-fe-common-lib'
1312
import { MultiValue } from 'react-select'
1413
import { toast } from 'react-toastify'
@@ -111,9 +110,9 @@ export default function AppDetailsPage({ isV2 }: AppDetailsProps) {
111110
setGroupFilterOptions(_groupFilterOption)
112111
}
113112
} catch (error) {
114-
noop;
113+
showError(error)
115114
}
116-
setAppListLoading(true)
115+
setAppListLoading(false)
117116
}
118117

119118
const getAppListData = async (): Promise<void> => {
@@ -133,7 +132,9 @@ export default function AppDetailsPage({ isV2 }: AppDetailsProps) {
133132
.sort(sortOptionsByLabel),
134133
)
135134
}
136-
} catch (error) {noop}
135+
} catch (error) {
136+
showError(error)
137+
}
137138
setAppListLoading(false)
138139
}
139140

src/components/v2/appDetails/AppDetails.component.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useEffect, useRef, useState } from 'react'
22
import './appDetails.scss'
33
import { useLocation, useParams } from 'react-router'
4-
import { DeploymentAppTypes, Progressing, noop } from '@devtron-labs/devtron-fe-common-lib'
4+
import { DeploymentAppTypes, Progressing, showError } from '@devtron-labs/devtron-fe-common-lib'
55
import { AppDetailsComponentType, AppType } from './appDetails.type'
66
import IndexStore from './index.store'
77
import EnvironmentStatusComponent from './sourceInfo/environmentStatus/EnvironmentStatus.component'
@@ -105,7 +105,9 @@ const AppDetailsComponent = ({
105105
}
106106
},
107107
)
108-
.catch(noop)
108+
.catch((error) => {
109+
showError(error)
110+
})
109111
}
110112

111113
const processDeploymentStatusData = (deploymentStatusDetailRes: DeploymentStatusDetailsType): void => {

0 commit comments

Comments
 (0)