Skip to content

Commit bfd1944

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

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

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

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

src/components/app/details/main.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ export default function AppDetailsPage({ isV2 }: AppDetailsProps) {
111111
setGroupFilterOptions(_groupFilterOption)
112112
}
113113
} catch (error) {
114-
noop;
114+
showError(error)
115115
}
116-
setAppListLoading(true)
116+
setAppListLoading(false)
117117
}
118118

119119
const getAppListData = async (): Promise<void> => {
@@ -133,7 +133,9 @@ export default function AppDetailsPage({ isV2 }: AppDetailsProps) {
133133
.sort(sortOptionsByLabel),
134134
)
135135
}
136-
} catch (error) {noop}
136+
} catch (error) {
137+
showError(error)
138+
}
137139
setAppListLoading(false)
138140
}
139141

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, AppStreamData, AppType } from './appDetails.type'
66
import IndexStore from './index.store'
77
import EnvironmentStatusComponent from './sourceInfo/environmentStatus/EnvironmentStatus.component'
@@ -106,7 +106,9 @@ const AppDetailsComponent = ({
106106
}
107107
},
108108
)
109-
.catch(noop)
109+
.catch((error) => {
110+
showError(error)
111+
})
110112
}
111113

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

0 commit comments

Comments
 (0)