You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/04/14 15:53:14 UTC

[GitHub] [superset] eschutho commented on a change in pull request #14093: feat: error messages when connecting to MSSQL

eschutho commented on a change in pull request #14093:
URL: https://github.com/apache/superset/pull/14093#discussion_r613372000



##########
File path: superset/db_engine_specs/mssql.py
##########
@@ -15,15 +15,33 @@
 # specific language governing permissions and limitations
 # under the License.
 import logging
+import re
 from datetime import datetime
 from typing import Any, List, Optional, Tuple
 
+from flask_babel import gettext as __
+
 from superset.db_engine_specs.base import BaseEngineSpec, LimitMethod
+from superset.errors import SupersetErrorType
 from superset.utils import core as utils
 
 logger = logging.getLogger(__name__)
 
 
+# Regular expressions to catch custom errors
+TEST_CONNECTION_ACCESS_DENIED_REGEX = re.compile("Adaptive Server connection failed")
+TEST_CONNECTION_INVALID_HOSTNAME_REGEX = re.compile(
+    r"Adaptive Server is unavailable or does not exist \((?P<hostname>.*?)\)"
+    "(?!.*Net-Lib error).*$"
+)
+TEST_CONNECTION_PORT_CLOSED_REGEX = re.compile(
+    r"Net-Lib error during Connection refused \(61\)"
+)
+TEST_CONNECTION_HOST_DOWN_REGEX = re.compile(

Review comment:
       are we only going to use these errors for test connection, or will we be using them for database creation as well?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org