AAfghahi commented on code in PR #22625:
URL: https://github.com/apache/superset/pull/22625#discussion_r1068574149
##########
superset/databases/commands/test_connection.py:
##########
@@ -163,29 +175,29 @@ def ping(engine: Engine) -> bool:
) from ex
except DBAPIError as ex:
event_logger.log_with_context(
- action=f"test_connection_error.{ex.__class__.__name__}",
+ action=get_log_connection_action("test_connection_error",
ssh_tunnel),
engine=database.db_engine_spec.__name__,
)
# check for custom errors (wrong username, wrong password, etc)
errors = database.db_engine_spec.extract_errors(ex, context)
raise SupersetErrorsException(errors) from ex
except SupersetSecurityException as ex:
event_logger.log_with_context(
- action=f"test_connection_error.{ex.__class__.__name__}",
+ action=get_log_connection_action("test_connection_error",
ssh_tunnel),
engine=database.db_engine_spec.__name__,
)
raise DatabaseSecurityUnsafeError(message=str(ex)) from ex
except SupersetTimeoutException as ex:
event_logger.log_with_context(
- action=f"test_connection_error.{ex.__class__.__name__}",
+ action=get_log_connection_action("test_connection_error",
ssh_tunnel),
engine=database.db_engine_spec.__name__,
)
# bubble up the exception to return a 408
raise ex
except Exception as ex:
event_logger.log_with_context(
- action=f"test_connection_error.{ex.__class__.__name__}",
+ action=get_log_connection_action("test_connection_error",
ssh_tunnel),
Review Comment:
add param for exc
--
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]