diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-03-07 16:59:53 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-03-15 10:48:14 -0700 |
| commit | f558c835a41052b7609f0f0b27c5bbc4fe6b024d (patch) | |
| tree | c55b5d64e71315677ba2f1845ecfcc3019b06d62 /lib/std/Build/CheckObjectStep.zig | |
| parent | 4efeeaac881c5583321e8b385e90f004e99bc3d1 (diff) | |
| download | zig-f558c835a41052b7609f0f0b27c5bbc4fe6b024d.tar.gz zig-f558c835a41052b7609f0f0b27c5bbc4fe6b024d.zip | |
std.Build.CheckObjectStep: better error message
when reading the file fails
Diffstat (limited to 'lib/std/Build/CheckObjectStep.zig')
| -rw-r--r-- | lib/std/Build/CheckObjectStep.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/Build/CheckObjectStep.zig b/lib/std/Build/CheckObjectStep.zig index 2a58850fab..7cac2d04ec 100644 --- a/lib/std/Build/CheckObjectStep.zig +++ b/lib/std/Build/CheckObjectStep.zig @@ -314,14 +314,14 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { const self = @fieldParentPtr(CheckObjectStep, "step", step); const src_path = self.source.getPath(b); - const contents = try fs.cwd().readFileAllocOptions( + const contents = fs.cwd().readFileAllocOptions( gpa, src_path, self.max_bytes, null, @alignOf(u64), null, - ); + ) catch |err| return step.fail("unable to read '{s}': {s}", .{ src_path, @errorName(err) }); const output = switch (self.obj_format) { .macho => try MachODumper.parseAndDump(step, contents, .{ |
