diff --git a/apps/frontend/lib/api/common.ts b/apps/frontend/lib/api/common.ts index 4c052df..bd1e885 100644 --- a/apps/frontend/lib/api/common.ts +++ b/apps/frontend/lib/api/common.ts @@ -1,3 +1,5 @@ +import { toast } from "sonner"; + export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'; export interface APIResponse { @@ -64,4 +66,8 @@ export function handleAPIError(error: unknown, handler: (e: APIError) => void): throw error; } +} + +export function GeneralErrorHandler(e: APIError) { + toast.error(`${e.message}`) } \ No newline at end of file