diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx index a92d6f6440..612a566923 100644 --- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx +++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx @@ -89,6 +89,9 @@ const engineSpecificAlertMapping = { }; const errorAlertMapping = { + GENERIC_DB_ENGINE_ERROR: { + message: t('Generic database engine error'), + }, CONNECTION_MISSING_PARAMETERS_ERROR: { message: t('Missing Required Fields'), description: t('Please complete all required fields.'), @@ -929,6 +932,7 @@ const DatabaseModal: FunctionComponent = ({ } description={ errorAlertMapping[validationErrors?.error_type]?.description || + validationErrors?.description || JSON.stringify(validationErrors) } showIcon diff --git a/superset-frontend/src/views/CRUD/hooks.ts b/superset-frontend/src/views/CRUD/hooks.ts index b0ca13d96a..cdb0cdc838 100644 --- a/superset-frontend/src/views/CRUD/hooks.ts +++ b/superset-frontend/src/views/CRUD/hooks.ts @@ -689,6 +689,10 @@ export function useDatabaseValidation() { url: string; idx: number; }; + issue_codes?: { + code?: number; + message?: string; + }[]; }; message: string; }, @@ -744,6 +748,14 @@ export function useDatabaseValidation() { ), }; } + if (extra.issue_codes?.length) { + return { + ...obj, + error_type, + description: message || extra.issue_codes[0]?.message, + }; + } + return obj; }, {},