Skip to content
Snippets Groups Projects
Commit 6629abc5 authored by Zoltan Runyo's avatar Zoltan Runyo
Browse files

Handle invalid CSentry ID

parent a0f117c8
No related branches found
No related tags found
2 merge requests!139Merge before release,!136Handle invalid CSentry ID
Pipeline #110172 passed
......@@ -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) {
......
......@@ -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(() => {
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment