Skip to content

Commit aa5cfad

Browse files
authored
Merge pull request #170 from gHashTag/feat/issue-167
fix(history): add error logging to silent catch {} handlers
2 parents c32a700 + f720380 commit aa5cfad

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)