feat: adding logging to validation (#16527)

* adding logging to validation

* Update superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
This commit is contained in:
AAfghahi
2021-09-13 19:09:40 -04:00
committed by GitHub
parent 1669947bcd
commit 376c685838
3 changed files with 9 additions and 3 deletions

View File

@@ -908,14 +908,14 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
/>
);
}
const message: Array<string> = Object.values(dbErrors);
const message: Array<string> =
typeof dbErrors === 'object' ? Object.values(dbErrors) : [];
return (
<Alert
type="error"
css={(theme: SupersetTheme) => antDErrorAlertStyles(theme)}
message="Database Creation Error"
description={message[0]}
description={message?.[0] || dbErrors}
/>
);
};