From 9505992e00c45867f7087567af32a69246de8536 Mon Sep 17 00:00:00 2001 From: Tarry Singh Date: Mon, 4 Sep 2023 13:34:37 +0000 Subject: [PATCH] workspace: log diagnostic message before returning NotFound to aid debugging. --- pjrt/pjrt.zig | 1 + zml/context.zig | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pjrt/pjrt.zig b/pjrt/pjrt.zig index 30dae31..cee62af 100644 --- a/pjrt/pjrt.zig +++ b/pjrt/pjrt.zig @@ -80,6 +80,7 @@ pub const Api = struct { break :blk .{ .inner = .{ .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; }, }, diff --git a/zml/context.zig b/zml/context.zig index 9e8c14d..32d95c9 100644 --- a/zml/context.zig +++ b/zml/context.zig @@ -98,7 +98,11 @@ pub const Context = struct { num_platforms += 1; } } - if (num_platforms == 0) return error.NotFound; + if (num_platforms == 0) { + log.err("No platform available", .{}); + return error.NoPlatformAvailable; + } + return .{ .platforms = platforms, };