From 02b64be999c45f378ea8ba19e0c930470e9fd3b3 Mon Sep 17 00:00:00 2001 From: Jeremie Fraeys Date: Wed, 4 Mar 2026 21:36:00 -0500 Subject: [PATCH] refactor(cli): update errors.zig to use io.zig Update errors.zig to use consolidated io module: - Replace colors.printError with io.printError - Replace colors.printWarning with io.printWarning - Replace colors.printInfo with io.printInfo All tests pass. --- cli/src/errors.zig | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cli/src/errors.zig b/cli/src/errors.zig index 388c196..5df98f8 100644 --- a/cli/src/errors.zig +++ b/cli/src/errors.zig @@ -1,5 +1,5 @@ const std = @import("std"); -const colors = @import("utils/colors.zig"); +const io = @import("utils/io.zig"); const crypto = @import("utils/crypto.zig"); /// User-friendly error types for CLI @@ -143,18 +143,18 @@ pub const ErrorHandler = struct { const message = ErrorMessages.getMessage(err); const suggestion = ErrorMessages.getSuggestion(err); - colors.printError("Error: {s}\n", .{message}); + io.printError("Error: {s}\n", .{message}); if (context) |ctx| { - colors.printWarning("Context: {s}\n", .{ctx}); + io.printWarning("Context: {s}\n", .{ctx}); } if (suggestion) |sug| { - colors.printInfo("Suggestion: {s}\n", .{sug}); + io.printInfo("Suggestion: {s}\n", .{sug}); } if (ErrorMessages.isUserFixable(err)) { - colors.printInfo("This error can be fixed by updating your configuration.\n", .{}); + io.printInfo("This error can be fixed by updating your configuration.\n", .{}); } } @@ -169,16 +169,16 @@ pub const ErrorHandler = struct { const suggestion = ErrorMessages.getSuggestion(err); const is_fixable = ErrorMessages.isUserFixable(err); - colors.printError("Error in '{s}': {s}\n", .{ command, message }); + io.printError("Error in '{s}': {s}\n", .{ command, message }); if (suggestion) |sug| { - colors.printInfo("Suggestion: {s}\n", .{sug}); + io.printInfo("Suggestion: {s}\n", .{sug}); } if (is_fixable) { - colors.printInfo("This is a user-fixable issue.\n", .{}); + io.printInfo("This is a user-fixable issue.\n", .{}); } else { - colors.printWarning("If this persists, check server logs or contact support.\n", .{}); + io.printWarning("If this persists, check server logs or contact support.\n", .{}); } // Exit with appropriate code