workspace: log diagnostic message before returning NotFound to aid debugging.

This commit is contained in:
Tarry Singh 2023-09-04 13:34:37 +00:00
parent 937cdec324
commit 9505992e00
2 changed files with 6 additions and 1 deletions

View File

@ -80,6 +80,7 @@ pub const Api = struct {
break :blk .{ break :blk .{
.inner = .{ .inner = .{
.handle = c.dlopen(&library_c, c.RTLD_LAZY | c.RTLD_LOCAL | c.RTLD_NODELETE) orelse { .handle = c.dlopen(&library_c, c.RTLD_LAZY | c.RTLD_LOCAL | c.RTLD_NODELETE) orelse {
log.err("Unable to dlopen plugin: {s}", .{library});
return error.FileNotFound; return error.FileNotFound;
}, },
}, },

View File

@ -98,7 +98,11 @@ pub const Context = struct {
num_platforms += 1; num_platforms += 1;
} }
} }
if (num_platforms == 0) return error.NotFound; if (num_platforms == 0) {
log.err("No platform available", .{});
return error.NoPlatformAvailable;
}
return .{ return .{
.platforms = platforms, .platforms = platforms,
}; };