mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-04-03 08:00:34 +00:00
better logging on FsCache init failure
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
const std = @import("std");
|
||||
const log = @import("../log.zig");
|
||||
const builtin = @import("builtin");
|
||||
const net = std.net;
|
||||
const posix = std.posix;
|
||||
@@ -29,7 +30,9 @@ const libcurl = @import("../sys/libcurl.zig");
|
||||
const http = @import("http.zig");
|
||||
const RobotStore = @import("Robots.zig").RobotStore;
|
||||
const WebBotAuth = @import("WebBotAuth.zig");
|
||||
|
||||
const Cache = @import("cache/Cache.zig");
|
||||
const FsCache = @import("cache/FsCache.zig");
|
||||
|
||||
const App = @import("../App.zig");
|
||||
const Network = @This();
|
||||
@@ -238,7 +241,18 @@ pub fn init(allocator: Allocator, app: *App, config: *const Config) !Network {
|
||||
null;
|
||||
|
||||
const cache = if (config.cacheDir()) |cache_dir_path|
|
||||
Cache{ .kind = .{ .fs = try .init(cache_dir_path) } }
|
||||
Cache{
|
||||
.kind = .{
|
||||
.fs = FsCache.init(cache_dir_path) catch |e| {
|
||||
log.err(.cache, "failed to init", .{
|
||||
.kind = "FsCache",
|
||||
.path = cache_dir_path,
|
||||
.err = e,
|
||||
});
|
||||
return e;
|
||||
},
|
||||
},
|
||||
}
|
||||
else
|
||||
null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user