Commit fa09c3a5e7

Isaac Freund <ifreund@ifreund.xyz>
2020-12-17 20:03:15
stage2: print package path on --pkg-begin failure
This makes it much easier for the user to figure out what has gone wrong than dumping an error return trace.
1 parent c102eb8
Changed files (1)
src/main.zig
@@ -622,11 +622,13 @@ fn buildOutputType(
                         i += 1;
                         const pkg_path = args[i];
 
-                        const new_cur_pkg = try Package.create(
+                        const new_cur_pkg = Package.create(
                             gpa,
                             fs.path.dirname(pkg_path),
                             fs.path.basename(pkg_path),
-                        );
+                        ) catch |err| {
+                            fatal("Failed to add package at path {}: {}", .{ pkg_path, @errorName(err) });
+                        };
                         new_cur_pkg.parent = cur_pkg;
                         try cur_pkg.add(gpa, pkg_name, new_cur_pkg);
                         cur_pkg = new_cur_pkg;