Skip to content

Commit 1816268

Browse files
authored
Merge pull request #180 from gHashTag/feat/issue-177
fix(research): add error logging to catch {} handlers in tri_research.zig
2 parents d576936 + 8529323 commit 1816268

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/tri/tri_research.zig

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,14 @@ fn runPerplexityQuery(allocator: std.mem.Allocator, args: []const []const u8) !v
260260
fn cacheAnswer(allocator: std.mem.Allocator, path: []const u8, answer: []const u8) !void {
261261
_ = allocator;
262262
if (path.len == 0) return;
263-
std.fs.cwd().makePath(CACHE_DIR) catch {};
263+
std.fs.cwd().makePath(CACHE_DIR) catch |err| {
264+
std.log.warn("failed to create cache dir: {s}", .{@errorName(err)});
265+
};
264266
const file = std.fs.cwd().createFile(path, .{}) catch return;
265267
defer file.close();
266-
file.writeAll(answer) catch {};
268+
file.writeAll(answer) catch |err| {
269+
std.log.warn("failed to write cache: {s}", .{@errorName(err)});
270+
};
267271
}
268272

269273
/// Offline pattern matching for common Zig errors

0 commit comments

Comments
 (0)