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:
@@ -33,7 +33,7 @@ export const createHandleDrop = ({
|
||||
|
||||
const droppedData = JSON.parse(data);
|
||||
const canvasElement = document.getElementById("work-space-three-d-canvas");
|
||||
if (!canvasElement) throw new Error("Canvas element not found");
|
||||
if (!canvasElement) return;
|
||||
|
||||
const rect = canvasElement.getBoundingClientRect();
|
||||
const relativeX = event.clientX - rect.left;
|
||||
|
||||
@@ -680,7 +680,7 @@ export default function Dropped3dWidgets() {
|
||||
event.preventDefault();
|
||||
|
||||
const canvasElement = document.getElementById("work-space-three-d-canvas");
|
||||
if (!canvasElement) throw new Error("Canvas element not found");
|
||||
if (!canvasElement) return;
|
||||
|
||||
const canvasRect = canvasElement.getBoundingClientRect();
|
||||
const relativeX = event.clientX - canvasRect.left;
|
||||
@@ -744,7 +744,7 @@ export default function Dropped3dWidgets() {
|
||||
const canvasElement = document.getElementById(
|
||||
"work-space-three-d-canvas"
|
||||
);
|
||||
if (!canvasElement) throw new Error("Canvas element not found");
|
||||
if (!canvasElement) return;
|
||||
const canvasRect = canvasElement.getBoundingClientRect();
|
||||
const relativeX = event.clientX - canvasRect.left;
|
||||
const relativeY = event.clientY - canvasRect.top;
|
||||
|
||||
Reference in New Issue
Block a user