Explorar o código

report errors (#4315)

Feroze Mohideen %!s(int64=2) %!d(string=hai) anos
pai
achega
80ce1605d5

+ 5 - 1
dashboard/src/main/home/infrastructure-dashboard/ClusterFormContextProvider.tsx

@@ -85,7 +85,7 @@ const ClusterFormContextProvider: React.FC<ClusterFormContextProviderProps> = ({
   });
   const {
     handleSubmit,
-    formState: { isSubmitting },
+    formState: { isSubmitting, errors },
   } = clusterForm;
 
   const queryClient = useQueryClient();
@@ -106,6 +106,9 @@ const ClusterFormContextProvider: React.FC<ClusterFormContextProviderProps> = ({
         <ErrorComponent message={updateClusterError} maxWidth="600px" />
       );
     }
+    if (Object.keys(errors).length > 0) {
+      console.log("errors", errors);
+    }
     if (isHandlingPreflightChecks) {
       props.loadingText = "Running preflight checks...";
     }
@@ -123,6 +126,7 @@ const ClusterFormContextProvider: React.FC<ClusterFormContextProviderProps> = ({
     updateClusterError,
     isHandlingPreflightChecks,
     isCreatingContract,
+    errors,
   ]);
 
   const onSubmit = handleSubmit(async (data) => {