From 3a9cfa86e5f03aa68a3ad8006c637bc31a42edc6 Mon Sep 17 00:00:00 2001 From: Burhanuddin Khatri <144617735+BurhanCantCode@users.noreply.github.com> Date: Fri, 2 Aug 2024 22:24:12 +0500 Subject: [PATCH] Update visionUtils.ts --- utils/visionUtils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/visionUtils.ts b/utils/visionUtils.ts index af2801d..70775ea 100644 --- a/utils/visionUtils.ts +++ b/utils/visionUtils.ts @@ -41,8 +41,8 @@ export const scanProduct = async (imageData: string): Promise<{ name: string; qu } else { throw new Error('No labels detected in the image'); } - } catch (error) { + } catch (error: unknown) { console.error('Error in scanProduct:', error); - throw new Error(`Failed to scan product: ${error.message}`); + throw new Error(`Failed to scan product: ${error instanceof Error ? error.message : 'Unknown error'}`); } };