mirror of
https://github.com/apache/superset.git
synced 2026-04-20 16:44:46 +00:00
chore: proper current_app.config proxy usage (#34345)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
6c9cda758a
commit
cb27d5fe8d
@@ -158,6 +158,7 @@ def set_app_error_handlers(app: Flask) -> None: # noqa: C901
|
||||
@app.errorhandler(HTTPException)
|
||||
def show_http_exception(ex: HTTPException) -> FlaskResponse:
|
||||
logger.warning("HTTPException", exc_info=True)
|
||||
|
||||
if (
|
||||
"text/html" in request.accept_mimetypes
|
||||
and not app.config["DEBUG"]
|
||||
@@ -185,6 +186,7 @@ def set_app_error_handlers(app: Flask) -> None: # noqa: C901
|
||||
or SupersetErrorsException, with a specific status code and error type
|
||||
"""
|
||||
logger.warning("CommandException", exc_info=True)
|
||||
|
||||
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
|
||||
@@ -208,6 +210,7 @@ def set_app_error_handlers(app: Flask) -> None: # noqa: C901
|
||||
"""Catch-all, to ensure all errors from the backend conform to SIP-40"""
|
||||
logger.warning("Exception", exc_info=True)
|
||||
logger.exception(ex)
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user