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:
2025-06-24 09:31:45 +05:30
parent 385a64d307
commit b49f431ebf
97 changed files with 127 additions and 119 deletions

View File

@@ -17,7 +17,7 @@ export const upsertProductOrEventApi = async (body: any) => {
);
if (!response.ok) {
throw new Error("Failed to add product or event");
console.error("Failed to add product or event");
}
const result = await response.json();

View File

@@ -17,7 +17,7 @@ export const deleteEventDataApi = async (body: any) => {
);
if (!response.ok) {
throw new Error("Failed to delete event data");
console.error("Failed to delete event data");
}
const result = await response.json();

View File

@@ -17,7 +17,7 @@ export const deleteProductApi = async (body: any) => {
);
if (!response.ok) {
throw new Error("Failed to delete product data");
console.error("Failed to delete product data");
}
const result = await response.json();

View File

@@ -19,7 +19,7 @@ export const getProductApi = async (
);
if (!response.ok) {
throw new Error("Failed to fetch product data");
console.error("Failed to fetch product data");
}
const result = await response.json();

View File

@@ -16,7 +16,7 @@ export const getAllProductsApi = async (projectId: string, versionId: string) =>
);
if (!response.ok) {
throw new Error("Failed to fetch all products data");
console.error("Failed to fetch all products data");
}
const result = await response.json();

View File

@@ -19,7 +19,7 @@ export const renameProductApi = async (body: {
});
if (!response.ok) {
throw new Error("Failed to rename product");
console.error("Failed to rename product");
}
const result = await response.json();