From 870ee1df1f5fb5bd1f579bf264aadf966181a687 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Mon, 14 Oct 2024 17:58:14 +0200 Subject: [PATCH] feat: log config file errors --- src/main.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.zig b/src/main.zig index 0356280..b12761e 100644 --- a/src/main.zig +++ b/src/main.zig @@ -355,7 +355,10 @@ const config = @import("config"); pub fn read_config(allocator: std.mem.Allocator, buf: *?[]const u8) config { const file_name = get_app_config_file_name(application_name) catch return .{}; - return read_json_config_file(allocator, file_name, buf) catch .{}; + return read_json_config_file(allocator, file_name, buf) catch |e| { + log.logger("config").print_err("read_config", "error reading config file: {any}", .{e}); + return .{}; + }; } fn read_json_config_file(allocator: std.mem.Allocator, file_name: []const u8, buf: *?[]const u8) !config {