kgabryje commented on code in PR #34674:
URL: https://github.com/apache/superset/pull/34674#discussion_r2300971500


##########
superset/db_engine_specs/base.py:
##########
@@ -1331,7 +1331,18 @@ def extract_errors(
         raw_message = cls._extract_error_message(ex)
 
         context = context or {}
-        for regex, (message, error_type, extra) in cls.custom_errors.items():
+
+        config_custom_errors = app.config.get("CUSTOM_DATABASE_ERRORS", {})
+        if not isinstance(config_custom_errors, dict):
+            config_custom_errors = {}
+        db_engine_custom_errors = config_custom_errors.get(cls.engine_name, {})

Review Comment:
   Should we also check for `cls.engine`? I tested on sqlite, and when I used 
`sqlite` as key in CUSTOM_DATABASE_ERRORS dict, it didn't work because 
`cls.engine_name` returns SQLite. Perhaps we could allow for both "human 
readable" and "normal" engine names?



-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org

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


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

Reply via email to