You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/09/01 09:08:51 UTC

[GitHub] [superset] betodealmeida commented on a change in pull request #16527: feat: adding logging to validation

betodealmeida commented on a change in pull request #16527:
URL: https://github.com/apache/superset/pull/16527#discussion_r699631144



##########
File path: superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx
##########
@@ -908,14 +908,14 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
         />
       );
     }
-
-    const message: Array<string> = Object.values(dbErrors);
+    const message: Array<string> | null =
+      typeof dbErrors === 'object' ? Object.values(dbErrors) : null;
     return (
       <Alert
         type="error"
         css={(theme: SupersetTheme) => antDErrorAlertStyles(theme)}
         message="Database Creation Error"
-        description={message[0]}
+        description={message?.[0] || dbErrors}

Review comment:
       Do you know why we're showing just the first message here?
   
   It would be better (and easy) to show all of them:
   
   ```suggestion
           description={message.join('\n') || dbErrors}
   ```
   

##########
File path: superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx
##########
@@ -908,14 +908,14 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
         />
       );
     }
-
-    const message: Array<string> = Object.values(dbErrors);
+    const message: Array<string> | null =
+      typeof dbErrors === 'object' ? Object.values(dbErrors) : null;

Review comment:
       ```suggestion
       const message: Array<string> =
         typeof dbErrors === 'object' ? Object.values(dbErrors) : [];
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org