From f25bcddcaeb755f4808755977da18e1246c4233e Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 5 Jun 2025 05:44:54 +0000 Subject: [PATCH] improve typings --- src/global.d.ts | 4 ++-- src/hooks.client.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/global.d.ts b/src/global.d.ts index b90c917c5..4c3895a50 100644 --- a/src/global.d.ts +++ b/src/global.d.ts @@ -3,12 +3,12 @@ interface Window { } namespace App { interface Error { - type: string = 'unknown', + type?: string, } interface HandleClientError { message: string; status?: number; - type: string; + type?: string; } } \ No newline at end of file diff --git a/src/hooks.client.ts b/src/hooks.client.ts index c04dece39..b3d426ffd 100644 --- a/src/hooks.client.ts +++ b/src/hooks.client.ts @@ -13,7 +13,8 @@ Sentry.init({ export const handleError: HandleClientError = ({ error, message, status }) => { console.error(error); - let type = 'unknown'; + + let type; if (error instanceof AppwriteException) { status = error.code === 0 ? undefined : error.code; message = error.message;