From 14eba436bfbc9aaa5c85e2899263403ab5108481 Mon Sep 17 00:00:00 2001 From: Jeremie Fraeys Date: Wed, 18 Feb 2026 13:51:13 -0500 Subject: [PATCH] feat(cli): include command name in error messages and crash reports Implement TODO in handleCommandError: - Log command name with error for crash report context - Display 'Error in \'{s}': {s}' instead of generic 'Error: {s}' - Helps users identify which command failed Build verified: zig build --release=fast --- cli/src/errors.zig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cli/src/errors.zig b/cli/src/errors.zig index 948d82a..388c196 100644 --- a/cli/src/errors.zig +++ b/cli/src/errors.zig @@ -159,7 +159,9 @@ pub const ErrorHandler = struct { } pub fn handleCommandError(err: anyerror, command: []const u8) void { - _ = command; // TODO: Use command in crash report + // Include command in crash report context + std.log.debug("Command '{s}' failed with error: {}", .{ command, err }); + // Send crash report for non-user-fixable errors sendCrashReport(); @@ -167,7 +169,7 @@ pub const ErrorHandler = struct { const suggestion = ErrorMessages.getSuggestion(err); const is_fixable = ErrorMessages.isUserFixable(err); - colors.printError("Error: {s}\n", .{message}); + colors.printError("Error in '{s}': {s}\n", .{ command, message }); if (suggestion) |sug| { colors.printInfo("Suggestion: {s}\n", .{sug});