diff --git a/src/api/SwaggerApi.js b/src/api/SwaggerApi.js index 428bb2e1f33edc65ff8a891ea79fc71a76e23a81..6bd204c80850b3d971bb416e3a3820431437e6f2 100644 --- a/src/api/SwaggerApi.js +++ b/src/api/SwaggerApi.js @@ -451,10 +451,10 @@ export function useHost(id) { return useAsync({ fcn: boundMethod}); } -export function useCSentryHost() { +export function useCSentryHost(onError) { const api = useContext(apiContext); const method = useCallAndUnpack((id) => api.apis.Hosts.findCSentryHostById({hostCSEntryId: id}), unpackHost) - return useAsync({ fcn: method, call: false }); + return useAsync({ fcn: method, call: false, onError: onError }); } export function useAvailableHost(id) { diff --git a/src/components/IOC/IOCDetailFetcher.js b/src/components/IOC/IOCDetailFetcher.js index 7ad6b1573e589856f87e3a3cc461a146247dbcc2..31eb1b1126070663d19ef5ae4ce0cd56c86e1c9a 100644 --- a/src/components/IOC/IOCDetailFetcher.js +++ b/src/components/IOC/IOCDetailFetcher.js @@ -7,7 +7,7 @@ export function IOCDetailFetcher({ ioc, index, setIocs }) { } const [tagOrCommitId, getTagOrCommitId] = useTagsAndCommitIds(onError); - const [host, getHost] = useCSentryHost(); + const [host, getHost] = useCSentryHost(onError); const [iocStatus, getIocStatus] = useIocStatus(); useEffect(() => { diff --git a/src/components/deployments/DeploymentDetailFetcher.js b/src/components/deployments/DeploymentDetailFetcher.js index ea2638e398d5200e19453ccf57f405a4bc6cc531..b3c6579ce59ad557464f93595ac2d506dbd88f61 100644 --- a/src/components/deployments/DeploymentDetailFetcher.js +++ b/src/components/deployments/DeploymentDetailFetcher.js @@ -7,7 +7,7 @@ export function DeploymentDetailFetcher({ deployment, index, setDeployments }) { } const [tagOrCommitId, getTagOrCommitId] = useTagsAndCommitIds(onError); - const [host, getHost] = useCSentryHost(); + const [host, getHost] = useCSentryHost(onError); useEffect(() => { getTagOrCommitId(deployment.gitProjectId, deployment.sourceVersion);