fix: Dynamic form to connect to Snowflake DB is not displaying authentication errors (#19491)

* fix: Dynamic form to connect to Snowflake DB is not displaying authentication errors

* pr comments
This commit is contained in:
Diego Medina 2022-04-05 15:11:33 -04:00 committed by GitHub
parent 1521ab3b6f
commit 634693b270
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -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<DatabaseModalProps> = ({
}
description={
errorAlertMapping[validationErrors?.error_type]?.description ||
validationErrors?.description ||
JSON.stringify(validationErrors)
}
showIcon

View File

@ -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;
},
{},