rusackas commented on code in PR #20013:
URL: https://github.com/apache/superset/pull/20013#discussion_r872682528


##########
superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx:
##########
@@ -1083,15 +1085,23 @@ const DatabaseModal: 
FunctionComponent<DatabaseModalProps> = ({
 
   // eslint-disable-next-line consistent-return
   const errorAlert = () => {
+    let alertErrors: string[] = [];
     if (isEmpty(dbErrors) === false) {
-      const message: Array<string> =
-        typeof dbErrors === 'object' ? Object.values(dbErrors) : [];
+      alertErrors = typeof dbErrors === 'object' ? Object.values(dbErrors) : 
[];
+    } else if (db?.engine === Engines.Snowflake) {
+      alertErrors =
+        validationErrors?.error_type === 'GENERIC_DB_ENGINE_ERROR'
+          ? [validationErrors?.description]
+          : [];
+    }
+
+    if (alertErrors.length) {
       return (
         <Alert
           type="error"
           css={(theme: SupersetTheme) => antDErrorAlertStyles(theme)}
           message={t('Database Creation Error')}
-          description={message?.[0] || dbErrors}
+          description={t(alertErrors[0])}

Review Comment:
   Looking above at line 1095, it seems there's a condition where `alertErrors` 
might be `[]`, in which case this would be translating/displaying `undefined` 
right?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to