소스 검색

report errors (#4315)

Feroze Mohideen 2 년 전
부모
커밋
80ce1605d5
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      dashboard/src/main/home/infrastructure-dashboard/ClusterFormContextProvider.tsx

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

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