Antonio-RiveroMartnez commented on code in PR #21838:
URL: https://github.com/apache/superset/pull/21838#discussion_r1004877570


##########
superset/databases/commands/create.py:
##########
@@ -46,6 +46,13 @@ def run(self) -> Model:
         try:
             # Test connection before starting create transaction
             TestConnectionDatabaseCommand(self._properties).run()
+        except DatabaseConnectionFailedError as ex:
+            event_logger.log_with_context(
+                action=f"db_creation_failed.{ex.__class__.__name__}",
+                engine=self._properties.get("sqlalchemy_uri", 
"").split(":")[0],
+            )
+            # So we can show the original message
+            raise ex

Review Comment:
   `Original message` -> Custom message after extracting the error.
   Otherwise the `DatabaseConnectionFailedError` would have the default 
`Connection failed ...` message caught from below.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to