Add any to err on try catch

This commit is contained in:
Takeshi Kimata
2024-04-20 20:30:24 +09:00
parent 1f73da2c08
commit a1705d916e
13 changed files with 38 additions and 38 deletions

View File

@@ -17,7 +17,7 @@ export default function RunsPage({ projectId }: Props) {
try {
const data = await fetchRuns(projectId);
setRuns(data);
} catch (error) {
} catch (error: any) {
console.error("Error in effect:", error.message);
}
}
@@ -31,7 +31,7 @@ export default function RunsPage({ projectId }: Props) {
const updateRuns = [...runs];
updateRuns.push(newRun);
setRuns(updateRuns);
} catch (error) {
} catch (error: any) {
console.error("Error deleting run:", error);
}
};
@@ -41,7 +41,7 @@ export default function RunsPage({ projectId }: Props) {
await deleteRun(runId);
const data = await fetchRuns(projectId);
setRuns(data);
} catch (error) {
} catch (error: any) {
console.error("Error deleting run:", error);
}
};

View File

@@ -71,7 +71,7 @@ export default function RunEditor({ projectId, runId }: Props) {
setTestRun(runData);
const foldersData = await fetchFolders(projectId);
setFolders(foldersData);
} catch (error) {
} catch (error: any) {
console.error("Error in effect:", error.message);
}
}
@@ -101,7 +101,7 @@ export default function RunEditor({ projectId, runId }: Props) {
});
setTestCases(testCasesData);
} catch (error) {
} catch (error: any) {
console.error("Error fetching cases data:", error.message);
}
};

View File

@@ -19,7 +19,7 @@ async function fetchRun(runId: string) {
const data = await response.json();
return data;
} catch (error) {
} catch (error: any) {
console.error("Error fetching data:", error.message);
}
}
@@ -41,7 +41,7 @@ async function fetchRuns(projectId: string) {
const data = await response.json();
return data;
} catch (error) {
} catch (error: any) {
console.error("Error fetching data:", error.message);
}
}
@@ -72,7 +72,7 @@ async function createRun(projectId: string) {
}
const data = await response.json();
return data;
} catch (error) {
} catch (error: any) {
console.error("Error creating new test run:", error);
throw error;
}
@@ -96,7 +96,7 @@ async function updateRun(updateTestRun: RunType) {
}
const data = await response.json();
return data;
} catch (error) {
} catch (error: any) {
console.error("Error updating run:", error);
throw error;
}
@@ -117,7 +117,7 @@ async function deleteRun(runId: number) {
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
} catch (error) {
} catch (error: any) {
console.error("Error deleting run:", error);
throw error;
}
@@ -140,7 +140,7 @@ async function createRunCase(runId: string, caseId: number) {
}
const data = await response.json();
return data;
} catch (error) {
} catch (error: any) {
console.error("Error creating new runcase:", error);
throw error;
}
@@ -161,7 +161,7 @@ async function deleteRunCase(runId: string, caseId: number) {
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
} catch (error) {
} catch (error: any) {
console.error("Error deleting runcase:", error);
throw error;
}