aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-01-28 01:09:42 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-01-28 01:09:42 -0800
commit128a2939010837058ef3bd375eb1f2e024d43577 (patch)
tree4b6ff42e7b315d64eab9e43819917fe58e58b330
parent6557df29122c328745b169ed7fe57f4333b40bc8 (diff)
downloadbun-128a2939010837058ef3bd375eb1f2e024d43577.tar.gz
bun-128a2939010837058ef3bd375eb1f2e024d43577.tar.zst
bun-128a2939010837058ef3bd375eb1f2e024d43577.zip
Make the parser error in bun install look better
-rw-r--r--src/install/install.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/install/install.zig b/src/install/install.zig
index 2885b5a26..4ae9574ac 100644
--- a/src/install/install.zig
+++ b/src/install/install.zig
@@ -5550,6 +5550,11 @@ pub const PackageManager = struct {
ctx.log.printForLogLevelWithEnableAnsiColors(Output.errorWriter(), false) catch {};
}
+ if (err == error.ParserError and ctx.log.errors > 0) {
+ Output.prettyErrorln("error: Failed to parse package.json", .{});
+ Global.crash();
+ }
+
Output.panic("<r><red>{s}<r> parsing package.json<r>", .{
@errorName(err),
});