aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build/CheckObjectStep.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-03-07 16:59:53 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-03-15 10:48:14 -0700
commitf558c835a41052b7609f0f0b27c5bbc4fe6b024d (patch)
treec55b5d64e71315677ba2f1845ecfcc3019b06d62 /lib/std/Build/CheckObjectStep.zig
parent4efeeaac881c5583321e8b385e90f004e99bc3d1 (diff)
downloadzig-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.zig4
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, .{