improve typings

This commit is contained in:
Damodar Lohani committed 2025-06-05 05:44:54 +00:00
1 parent 9042ca6f0b
commit f25bcddcae
2 files changed
+4 -3

No files matched your search

+2 -2
View File
@@ -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;
}
}
+2 -1
View File
@@ -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;