mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
feat: error messages when connecting to mssql (#14171)
* database errors for mssql * revisions
This commit is contained in:
@@ -284,11 +284,11 @@ Adaptive Server connection failed (mssqldb.cxiotftzsypc.us-west-2.rds.amazonaws.
|
||||
"""
|
||||
)
|
||||
result = MssqlEngineSpec.extract_errors(
|
||||
Exception(msg), context={"username": "testuser"}
|
||||
Exception(msg), context={"username": "testuser", "database": "testdb"}
|
||||
)
|
||||
assert result == [
|
||||
SupersetError(
|
||||
message='Either the username "testuser" or the password is incorrect.',
|
||||
message='Either the username "testuser", password, or database name "testdb" is incorrect.',
|
||||
error_type=SupersetErrorType.CONNECTION_ACCESS_DENIED_ERROR,
|
||||
level=ErrorLevel.ERROR,
|
||||
extra={
|
||||
@@ -296,8 +296,14 @@ Adaptive Server connection failed (mssqldb.cxiotftzsypc.us-west-2.rds.amazonaws.
|
||||
"issue_codes": [
|
||||
{
|
||||
"code": 1014,
|
||||
"message": "Issue 1014 - Either the username or the password is wrong.",
|
||||
}
|
||||
"message": "Issue 1014 - Either the username or "
|
||||
"the password is wrong.",
|
||||
},
|
||||
{
|
||||
"code": 1015,
|
||||
"message": "Issue 1015 - Either the database is "
|
||||
"spelled incorrectly or does not exist.",
|
||||
},
|
||||
],
|
||||
},
|
||||
)
|
||||
|
||||
@@ -124,7 +124,12 @@ class TestMySQLEngineSpecsDbEngineSpec(TestDbEngineSpec):
|
||||
"code": 1014,
|
||||
"message": "Issue 1014 - Either the"
|
||||
" username or the password is wrong.",
|
||||
}
|
||||
},
|
||||
{
|
||||
"code": 1015,
|
||||
"message": "Issue 1015 - Either the database is "
|
||||
"spelled incorrectly or does not exist.",
|
||||
},
|
||||
],
|
||||
},
|
||||
)
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from textwrap import dedent
|
||||
from unittest import mock
|
||||
|
||||
from superset.db_engine_specs.redshift import RedshiftEngineSpec
|
||||
from superset.errors import ErrorLevel, SupersetError, SupersetErrorType
|
||||
@@ -39,9 +38,14 @@ class TestRedshiftDbEngineSpec(TestDbEngineSpec):
|
||||
"issue_codes": [
|
||||
{
|
||||
"code": 1014,
|
||||
"message": "Issue 1014 - Either the username or "
|
||||
"the password is wrong",
|
||||
}
|
||||
"message": "Issue 1014 - Either the username "
|
||||
"or the password is wrong.",
|
||||
},
|
||||
{
|
||||
"code": 1015,
|
||||
"message": "Issue 1015 - Either the database is "
|
||||
"spelled incorrectly or does not exist.",
|
||||
},
|
||||
],
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user