From 0cda3291612796d059e367ca1095c7601e353c79 Mon Sep 17 00:00:00 2001 From: Soumyadas15 Date: Tue, 27 May 2025 00:53:54 +0530 Subject: [PATCH] chore(ui): add error toasts --- .../src/components/test-error-handling.tsx | 52 ------------------- 1 file changed, 52 deletions(-) delete mode 100644 frontend/src/components/test-error-handling.tsx diff --git a/frontend/src/components/test-error-handling.tsx b/frontend/src/components/test-error-handling.tsx deleted file mode 100644 index 8662c4f0..00000000 --- a/frontend/src/components/test-error-handling.tsx +++ /dev/null @@ -1,52 +0,0 @@ -'use client'; - -import React from 'react'; -import { Button } from '@/components/ui/button'; -import { handleApiError, handleApiSuccess, handleApiWarning } from '@/lib/error-handler'; -import { projectsApi } from '@/lib/api-enhanced'; - -export const TestErrorHandling: React.FC = () => { - const testError = () => { - // Simulate a 404 error - const error = new Error('Resource not found'); - (error as any).status = 404; - handleApiError(error, { operation: 'test operation', resource: 'test data' }); - }; - - const testSuccess = () => { - handleApiSuccess('Test successful!', 'This is a success message'); - }; - - const testWarning = () => { - handleApiWarning('Test warning', 'This is a warning message'); - }; - - const testEnhancedApi = async () => { - try { - // This will trigger error handling automatically - await projectsApi.getById('non-existent-id'); - } catch (error) { - console.log('Error caught:', error); - } - }; - - return ( -
-

Test Error Handling

-
- - - - -
-
- ); -}; \ No newline at end of file