The last line of this code panics (not errors, but panics) in a github action (ubuntu-latest):
var dir = std.fs.cwd().openDir(folder, .{}) catch |e| {
log.warn("Resource loader failed opening {s}. Error: {any}", .{ folder, e });
return false;
};
defer dir.close();
var i = dir.iterate();
while (i.next() catch return error.ReadRepoFileFailed) |file| {
Why would it fully just panic? Shouldnt it return an error if I was doing somthing wrong? Wat am I misunderstanding!
/home/runner/work/_temp/2a9c62fe/zig-x86_64-linux-0.14.1/lib/std/fs/Dir.zig:361:40: 0x110416b in nextLinux (test)
posix.lseek_SET(self.dir.fd, 0) catch unreachable; // EBADF here likely means that the Dir was not opened with iteration permissions
^
/home/runner/work/_temp/2a9c62fe/zig-x86_64-linux-0.14.1/lib/std/fs/Dir.zig:345:34: 0x10fef07 in next (test)
return self.nextLinux() catch |err| switch (err) {
^
/home/runner/work/resources/resources/src/resources.zig:336:22: 0x10fd2b8 in load_directory (test)
while (i.next() catch return error.ReadRepoFileFailed) |file| {