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

rusackas pushed a commit to branch chore/mcp-pool-stats-generic-error
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 31eb55a770bdf1c5305f868ae829b9a1c94d29be
Author: Claude Code <[email protected]>
AuthorDate: Sat May 30 10:29:06 2026 -0700

    chore(mcp): return a generic error from the webdriver pool-stats endpoint
    
    The pool-stats debug endpoint previously echoed the raw exception string
    back to the caller. It now logs the exception server-side and returns a
    fixed, generic error message instead. Surfaced by static analysis.
    
    Co-Authored-By: Claude Opus 4.8 <[email protected]>
---
 superset/mcp_service/screenshot/webdriver_config.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/superset/mcp_service/screenshot/webdriver_config.py 
b/superset/mcp_service/screenshot/webdriver_config.py
index 7c9a017965f..b5d4c86df45 100644
--- a/superset/mcp_service/screenshot/webdriver_config.py
+++ b/superset/mcp_service/screenshot/webdriver_config.py
@@ -19,8 +19,11 @@
 WebDriver pool configuration defaults for Superset MCP service
 """
 
+import logging
 from typing import Any, Dict
 
+logger = logging.getLogger(__name__)
+
 # Default WebDriver pool configuration
 DEFAULT_WEBDRIVER_POOL_CONFIG = {
     # Maximum number of WebDriver instances to keep in the pool
@@ -80,10 +83,13 @@ def get_pool_stats_endpoint() -> Any:
             stats = pool.get_stats()
 
             return jsonify({"webdriver_pool": stats, "status": "healthy"})
-        except Exception as e:
+        except Exception:
             from flask import jsonify
 
-            return jsonify({"error": str(e), "status": "error"}), 500
+            logger.exception("Failed to retrieve webdriver pool stats")
+            return jsonify(
+                {"error": "Failed to retrieve pool stats", "status": "error"}
+            ), 500
 
     return pool_stats
 

Reply via email to