From 5f781cfac71bfa7d94cd6fa5a82df65137eae632 Mon Sep 17 00:00:00 2001 From: Trinity Agent Date: Wed, 11 Mar 2026 19:14:24 +0000 Subject: [PATCH] fix(cmd): replace catch {} with error logging in command_interface.zig (#181) Replace silent error swallowing in listCategory() and listMcpTools() with proper std.log.warn() calls to log OOM failures. Co-Authored-By: Claude Opus 4.6 --- src/tri/command_interface.zig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/tri/command_interface.zig b/src/tri/command_interface.zig index f2b6de571d..96825d65b9 100644 --- a/src/tri/command_interface.zig +++ b/src/tri/command_interface.zig @@ -176,7 +176,9 @@ pub fn listCategory(category: CommandCategory) []const CommandMetadata { for (registry.items) |cmd| { if (std.mem.eql(u8, cmd.category, cat_str)) { - result.append(cmd) catch {}; + result.append(cmd) catch |err| { + std.log.warn("command append failed: {s}", .{@errorName(err)}); + }; } } @@ -244,7 +246,9 @@ pub fn listMcpTools() []const McpToolSchema { for (registry.items) |cmd| { if (cmd.mcp_enabled) { - result.append(toMcpTool(cmd)) catch {}; + result.append(toMcpTool(cmd)) catch |err| { + std.log.warn("MCP tool append failed: {s}", .{@errorName(err)}); + }; } }