feat: log config file errors

This commit is contained in:
CJ van den Berg 2024-10-14 17:58:14 +02:00
parent 2c3e8179dc
commit 870ee1df1f
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -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 {