mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-09-14 13:49:09 +02:00
claude_desktop: surface headroom MCP removal failures instead of swallowing them
The removal block's json.loads() was wrapped in a bare try/except that set data = None on any parse error, then silently no-op'd (isinstance(data, dict) is False) with exit 0 -- so a malformed claude_desktop_config.json meant the headroom entry was never removed and bashio::log.warning never fired. Drop the try/except so parse errors propagate naturally and the script exits non-zero, matching the sibling rtk removal block's existing convention and triggering the bashio::log.warning fallback. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgMcG1QjsSHcDQBxgPpRUw
This commit is contained in:
@@ -51,10 +51,7 @@ import os
|
||||
from pathlib import Path
|
||||
|
||||
path = Path(os.environ["CLAUDE_DESKTOP_CONFIG"])
|
||||
try:
|
||||
data = json.loads(path.read_text())
|
||||
except Exception:
|
||||
data = None
|
||||
data = json.loads(path.read_text())
|
||||
if isinstance(data, dict):
|
||||
servers = data.get("mcpServers")
|
||||
if isinstance(servers, dict) and servers.pop("headroom", None) is not None:
|
||||
|
||||
Reference in New Issue
Block a user