mikebridge commented on code in PR #44180:
URL: https://github.com/apache/superset/pull/44180#discussion_r3995224950


##########
superset/exceptions.py:
##########
@@ -206,7 +206,18 @@ class SpatialException(SupersetException):
 
 
 class CertificateException(SupersetException):
-    message = _("Invalid certificate")
+    def __init__(
+        self,
+        message: str = "",
+        exception: Optional[Exception] = None,
+        error_type: Optional[SupersetErrorType] = None,
+    ) -> None:
+        """Translate the default certificate error when constructing the 
exception."""
+        super().__init__(
+            message=message or _("Invalid certificate"),

Review Comment:
   Refuted by direct probe: flask-babel 4 falls back to NullTranslations with 
no app context — `python -c "from flask_babel import gettext; 
print(gettext('Invalid certificate'))"` returns the msgid without raising, and 
`CertificateException()` constructs fine outside any context (verified in this 
branch's venv). No RuntimeError, no masking.



-- 
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