feat: invalid DB name error messages (MySQL/Postgres/Redshift) (#14146)

* initial DB custom errors for mysql

* added redshift and postgres
This commit is contained in:
AAfghahi
2021-04-15 11:02:47 -04:00
committed by GitHub
parent 8ef572a412
commit eadff5f41e
9 changed files with 147 additions and 16 deletions

View File

@@ -76,6 +76,9 @@ TEST_CONNECTION_HOST_DOWN_REGEX = re.compile(
r'host "(?P<hostname>.*?)" (\(.*?\) )?and accepting\s+TCP/IP '
r"connections on port (?P<port>.*?)\?"
)
TEST_CONNECTION_UNKNOWN_DATABASE_REGEX = re.compile(
'database "(?P<database>.*?)" does not exist'
)
class PostgresBaseEngineSpec(BaseEngineSpec):
@@ -120,6 +123,13 @@ class PostgresBaseEngineSpec(BaseEngineSpec):
),
SupersetErrorType.TEST_CONNECTION_HOST_DOWN_ERROR,
),
TEST_CONNECTION_UNKNOWN_DATABASE_REGEX: (
__(
'We were unable to connect to your database named "%(database)s".'
" Please verify your database name and try again."
),
SupersetErrorType.TEST_CONNECTION_UNKNOWN_DATABASE_ERROR,
),
}
@classmethod