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 2023/01/12 19:49:53 UTC
[GitHub] [superset] AAfghahi commented on a diff in pull request #22625: feat: Add logging for ssh tunneling test_connection attempts
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: notifications-unsubscribe@superset.apache.org
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