Skip to content

Commit f720380

Browse files
Trinity Agentclaude
andcommitted
fix(history): add error logging to silent catch {} handlers (#167)
Replace empty catch {} handlers with proper error logging using std.log.debug for consistency. This prevents persistence failures from being silently swallowed. Changes: - History.add(): log save errors - ReplHistory.load(): log load errors - ReplHistory.saveBeforeExit(): log save errors Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 907b37b commit f720380

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/tri/tri_history.zig

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ pub const History = struct {
6161
}
6262

6363
// Save to file
64-
self.save() catch {};
64+
self.save() catch |err| {
65+
std.log.debug("history save: {s}", .{@errorName(err)});
66+
};
6567
}
6668

6769
/// Navigate to previous command
@@ -252,7 +254,9 @@ pub const ReplHistory = struct {
252254

253255
/// Load history from file
254256
pub fn load(self: *ReplHistory) !void {
255-
self.history.load() catch {};
257+
self.history.load() catch |err| {
258+
std.log.debug("history load: {s}", .{@errorName(err)});
259+
};
256260
}
257261

258262
/// Save current input and clear
@@ -312,7 +316,9 @@ pub const ReplHistory = struct {
312316

313317
/// Save history before exit
314318
pub fn saveBeforeExit(self: *ReplHistory) void {
315-
self.history.save() catch {};
319+
self.history.save() catch |err| {
320+
std.log.debug("history save: {s}", .{@errorName(err)});
321+
};
316322
}
317323
};
318324

0 commit comments

Comments
 (0)