Refactor error handling in API services to use console.error instead of throwing errors
- Updated various API service files to replace error throwing with console.error for better logging. - This change affects services related to aisles, assets, cameras, collaboration, comments, environment, lines, marketplace, simulation, visualization, and zones. - The modifications aim to improve error handling by logging errors to the console instead of interrupting the flow with thrown errors.
This commit is contained in:
@@ -17,7 +17,7 @@ export const restoreTrash = async (organization: string, projectId: string) => {
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch trash data");
|
||||
console.error("Failed to fetch trash data");
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
@@ -25,6 +25,6 @@ export const restoreTrash = async (organization: string, projectId: string) => {
|
||||
return data;
|
||||
} catch (error: any) {
|
||||
console.error("Failed to fetch trash data:", error);
|
||||
throw new Error(error.message || "Unknown error");
|
||||
console.error(error.message || "Unknown error");
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user