Add any to err on try catch
This commit is contained in:
@@ -153,7 +153,7 @@ export default function CaseEditor({
|
||||
try {
|
||||
const data = await fetchCase(params.caseId);
|
||||
setTestCase(data);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error("Error in effect:", error.message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ async function fetchDownloadAttachment(
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error("Error downloading file:", error);
|
||||
throw error;
|
||||
}
|
||||
@@ -54,7 +54,7 @@ async function fetchCreateAttachments(caseId: number, files: File[]) {
|
||||
|
||||
const responseData = await response.json();
|
||||
return responseData;
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error("Error uploading files:", error);
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@ async function fetchDeleteAttachment(attachmentId: number) {
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! Status: ${response.status}`);
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error("Error deleting file:", error);
|
||||
throw error;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ async function fetchCreateStep(newStepNo: number, parentCaseId: number) {
|
||||
throw new Error(`HTTP error! Status: ${response.status}`);
|
||||
}
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error("Error deleting project:", error);
|
||||
throw error;
|
||||
}
|
||||
@@ -38,7 +38,7 @@ async function fetchDeleteStep(stepId: number, parentCaseId: number) {
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! Status: ${response.status}`);
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error("Error deleting project:", error);
|
||||
throw error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user