mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
15 lines
402 B
TypeScript
15 lines
402 B
TypeScript
import { AppwriteException } from '@appwrite.io/console';
|
|
import type { HandleClientError } from '@sveltejs/kit';
|
|
|
|
export const handleError: HandleClientError = async ({ error, message, status }) => {
|
|
if (error instanceof AppwriteException) {
|
|
status = error.code === 0 ? undefined : error.code;
|
|
message = error.message;
|
|
}
|
|
|
|
return {
|
|
message,
|
|
status
|
|
};
|
|
};
|