AnuragShirke commited on
Commit
dc1b08f
·
1 Parent(s): 90cdfe6

feat(frontend): Add showErrorToast to errorHandling.ts

Browse files
rag-quest-hub/src/lib/errorHandling.ts CHANGED
@@ -31,6 +31,15 @@ export function showAuthErrorToast(error: ApiError, type: 'login' | 'register')
31
  });
32
  }
33
 
 
 
 
 
 
 
 
 
 
34
  // You can add more complex error handling functions here if needed.
35
  // For example, a function to create a retry mechanism.
36
 
 
31
  });
32
  }
33
 
34
+ export function showErrorToast(error: ApiError, title: string = "Error") {
35
+ const message = analyzeError(error);
36
+ toast({
37
+ title: title,
38
+ description: message,
39
+ variant: "destructive",
40
+ });
41
+ }
42
+
43
  // You can add more complex error handling functions here if needed.
44
  // For example, a function to create a retry mechanism.
45