You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by be...@apache.org on 2024/02/02 19:19:33 UTC

(superset) 01/01: fix: safer error message in alerts

This is an automated email from the ASF dual-hosted git repository.

beto pushed a commit to branch sc-76937
in repository https://gitbox.apache.org/repos/asf/superset.git

commit cf22e6151268f34dbaf9a6884ae6d66e0fcea7db
Author: Beto Dealmeida <ro...@dealmeida.net>
AuthorDate: Fri Feb 2 14:18:45 2024 -0500

    fix: safer error message in alerts
---
 superset/commands/report/alert.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/superset/commands/report/alert.py b/superset/commands/report/alert.py
index 68013a2c00..96637538d5 100644
--- a/superset/commands/report/alert.py
+++ b/superset/commands/report/alert.py
@@ -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:
         """