mirror of
https://github.com/apache/superset.git
synced 2026-05-07 17:04:58 +00:00
fix: safer error message in alerts (#27019)
(cherry picked from commit 686ce33ea5)
This commit is contained in:
committed by
Michael S. Molina
parent
5a6109b2de
commit
c974daa0c7
@@ -150,7 +150,7 @@ class AlertCommand(BaseCommand):
|
||||
rendered_sql, ALERT_SQL_LIMIT
|
||||
)
|
||||
|
||||
_, username = get_executor(
|
||||
executor, username = get_executor( # pylint: disable=unused-variable
|
||||
executor_types=app.config["ALERT_REPORTS_EXECUTE_AS"],
|
||||
model=self._report_schedule,
|
||||
)
|
||||
@@ -169,7 +169,12 @@ class AlertCommand(BaseCommand):
|
||||
logger.warning("A timeout occurred while executing the alert query: %s", ex)
|
||||
raise AlertQueryTimeout() from ex
|
||||
except Exception as ex:
|
||||
raise AlertQueryError(message=str(ex)) from ex
|
||||
logger.exception("An error occurred when running alert query")
|
||||
# The exception message here can reveal to much information to malicious
|
||||
# users, so we raise a generic message.
|
||||
raise AlertQueryError(
|
||||
message=_("An error occurred when running alert query")
|
||||
) from ex
|
||||
|
||||
def validate(self) -> None:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user