codeant-ai-for-open-source[bot] commented on code in PR #43896:
URL: https://github.com/apache/superset/pull/43896#discussion_r4225313265


##########
superset/views/error_handling.py:
##########
@@ -318,7 +318,15 @@ def show_unexpected_exception(ex: Exception) -> 
FlaskResponse:
 
         if "text/html" in request.accept_mimetypes and not app.config["DEBUG"]:
             path = files("superset") / "static/assets/500.html"
-            return send_file(path, max_age=0), 500
+            # Try to serve HTML file; fall back to JSON if not built. This is 
the
+            # last-resort handler, so a missing ``500.html`` (a webpack 
artifact
+            # absent in API-only/unbuilt deployments) must not raise its own
+            # ``FileNotFoundError`` and collapse the response to a bare 500 
with
+            # no SIP-40 body.
+            try:
+                return send_file(path, max_age=0), 500
+            except FileNotFoundError:
+                pass

Review Comment:
   ✅ **CodeAnt verified this suggestion was addressed in subsequent commits and 
marked this thread resolved** as of `6f36e71`.
   
   The HTML error-page fallback now catches `OSError` from `send_file` and 
falls through to the SIP-40 JSON error response.
   
   <sub>If that's not right, unresolve this thread and CodeAnt will leave it 
open.</sub>
   
   <!-- codeant-auto-resolve-reply -->



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