Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

Fix for issue in displaying the backend validation errors (#109)

Siddhiqd22b897ee95a
diff --git a/frontend/src/hooks/useExceptionHandler.jsx b/frontend/src/hooks/useExceptionHandler.jsx
index 9db174b84..c87ea1a92 100644
--- a/frontend/src/hooks/useExceptionHandler.jsx
+++ b/frontend/src/hooks/useExceptionHandler.jsx
@@ -3,7 +3,11 @@ import PropTypes from "prop-types";
const useExceptionHandler = () => {
const navigate = useNavigate();
- const handleException = (err, errMessage = "Something went wrong") => {
+ const handleException = (
+ err,
+ errMessage = "Something went wrong",
+ setBackendErrors = undefined
+ ) => {
if (!err) {
return {
type: "error",
@@ -16,6 +20,9 @@ const useExceptionHandler = () => {
switch (type) {
case "validation_error":
// Handle validation errors
+ if (setBackendErrors) {
+ setBackendErrors(err?.response?.data);
+ }
break;
case "subscription_error":
navigate("/trial-expired");