From f9c2565ab4b89324ff09f626c043fb25ca019a67 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Mon, 23 Mar 2026 15:54:11 -0700 Subject: [PATCH] fix(config): log warning instead of silently swallowing config.yaml errors (#2683) A bare `except Exception: pass` meant any YAML syntax error, bad value, or unexpected structure in config.yaml was silently ignored and the gateway fell back to .env / gateway.json without any indication. Users had no way to know why their config changes had no effect. Co-authored-by: sprmn24 Co-authored-by: Claude Sonnet 4.6 --- gateway/config.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gateway/config.py b/gateway/config.py index e60a70b4e..60387cc84 100644 --- a/gateway/config.py +++ b/gateway/config.py @@ -523,8 +523,13 @@ def load_gateway_config() -> GatewayConfig: os.environ["DISCORD_FREE_RESPONSE_CHANNELS"] = str(frc) if "auto_thread" in discord_cfg and not os.getenv("DISCORD_AUTO_THREAD"): os.environ["DISCORD_AUTO_THREAD"] = str(discord_cfg["auto_thread"]).lower() - except Exception: - pass + except Exception as e: + logger.warning( + "Failed to process config.yaml — falling back to .env / gateway.json values. " + "Check %s for syntax errors. Error: %s", + _home / "config.yaml", + e, + ) config = GatewayConfig.from_dict(gw_data)