fix: fixing mysql error message (#14416)

* fixing mysql error message

* Update tests/db_engine_specs/mysql_tests.py

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

* Update tests/db_engine_specs/mysql_tests.py

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

* Update tests/db_engine_specs/mysql_tests.py

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

* Update superset/db_engine_specs/mysql.py

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

* fixed broken test

* changed error type

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
This commit is contained in:
AAfghahi
2021-04-30 18:15:37 -04:00
committed by GitHub
parent e507508b48
commit 7466595563
4 changed files with 39 additions and 9 deletions

View File

@@ -62,6 +62,7 @@ CONNECTION_INVALID_USERNAME_REGEX = re.compile(
CONNECTION_INVALID_PASSWORD_REGEX = re.compile(
'password authentication failed for user "(?P<username>.*?)"'
)
CONNECTION_INVALID_PASSWORD_NEEDED_REGEX = re.compile("no password supplied")
CONNECTION_INVALID_HOSTNAME_REGEX = re.compile(
'could not translate host name "(?P<hostname>.*?)" to address: '
"nodename nor servname provided, or not known"
@@ -108,6 +109,10 @@ class PostgresBaseEngineSpec(BaseEngineSpec):
__('The password provided for username "%(username)s" is incorrect.'),
SupersetErrorType.CONNECTION_INVALID_PASSWORD_ERROR,
),
CONNECTION_INVALID_PASSWORD_NEEDED_REGEX: (
__("Please re-enter the password."),
SupersetErrorType.CONNECTION_ACCESS_DENIED_ERROR,
),
CONNECTION_INVALID_HOSTNAME_REGEX: (
__('The hostname "%(hostname)s" cannot be resolved.'),
SupersetErrorType.CONNECTION_INVALID_HOSTNAME_ERROR,