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:
@@ -16,7 +16,7 @@ async function loadInitialWallItems(
|
||||
const { organization, email } = getUserData();
|
||||
|
||||
if (!email) {
|
||||
throw new Error("No email found in localStorage");
|
||||
console.error("No email found in localStorage");
|
||||
}
|
||||
|
||||
const items = await getWallItems(organization, projectId, versionId);
|
||||
|
||||
@@ -276,7 +276,7 @@ export default function Builder() {
|
||||
<LayoutImage />
|
||||
</Bvh>
|
||||
|
||||
<WallGroup />
|
||||
{/* <WallGroup /> */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ function loadOnlyFloors(
|
||||
const originalPoint = originalLines.flat().find(([point]) => point.x === x && point.z === z);
|
||||
|
||||
if (!originalPoint) {
|
||||
throw new Error(`Original point for coordinate [${x}, ${z}] not found.`);
|
||||
console.error(`Original point for coordinate [${x}, ${z}] not found.`);
|
||||
}
|
||||
|
||||
return originalPoint;
|
||||
|
||||
@@ -148,7 +148,7 @@ const FloorPlanGroup = ({ floorPlanGroup, floorPlanGroupLine, floorPlanGroupPoin
|
||||
}
|
||||
|
||||
if (toolMode === "Wall") {
|
||||
// drawWall(raycaster, plane, floorPlanGroupPoint, snappedPoint, isSnapped, isSnappedUUID, line, ispreSnapped, anglesnappedPoint, isAngleSnapped, lines, floorPlanGroupLine, floorPlanGroup, ReferenceLineMesh, LineCreated, currentLayerPoint, dragPointControls, setNewLines, setDeletedLines, activeLayer, socket, projectId, selectedVersion?.versionId || '',);
|
||||
drawWall(raycaster, plane, floorPlanGroupPoint, snappedPoint, isSnapped, isSnappedUUID, line, ispreSnapped, anglesnappedPoint, isAngleSnapped, lines, floorPlanGroupLine, floorPlanGroup, ReferenceLineMesh, LineCreated, currentLayerPoint, dragPointControls, setNewLines, setDeletedLines, activeLayer, socket, projectId, selectedVersion?.versionId || '',);
|
||||
}
|
||||
|
||||
if (toolMode === "Floor") {
|
||||
|
||||
@@ -13,12 +13,12 @@ import { Base } from '@react-three/csg';
|
||||
|
||||
function Wall({ wall }: { readonly wall: Wall }) {
|
||||
const { walls } = useWallStore();
|
||||
const { getWallType, isWallFlipped } = useWallClassification(walls);
|
||||
const wallType = getWallType(wall);
|
||||
const [visible, setVisible] = useState(true);
|
||||
const { wallVisibility } = useWallVisibility();
|
||||
const meshRef = useRef<any>();
|
||||
const { camera } = useThree();
|
||||
const { wallVisibility } = useWallVisibility();
|
||||
const { getWallType, isWallFlipped } = useWallClassification(walls);
|
||||
const [visible, setVisible] = useState(true);
|
||||
const meshRef = useRef<any>();
|
||||
const wallType = getWallType(wall);
|
||||
|
||||
const wallFlipped = isWallFlipped(wall);
|
||||
|
||||
@@ -84,7 +84,6 @@ function Wall({ wall }: { readonly wall: Wall }) {
|
||||
camera.getWorldDirection(u);
|
||||
if (!u || !v) return;
|
||||
setVisible((2 * v.dot(u)) <= 0.1);
|
||||
|
||||
} else {
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user