mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
improve typings
This commit is contained in:
1 parent
9042ca6f0b
commit
f25bcddcae
2 files changed
+4
-3
No files matched your search
Vendored
+2
-2
@@ -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
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user