diff options
author | 2022-03-02 03:07:28 -0800 | |
---|---|---|
committer | 2022-03-02 03:07:28 -0800 | |
commit | 42f61ebf8ac560dbfb356fd276494ced58ce7dc8 (patch) | |
tree | 12c20212ca3d649f136e7aa646aef30a3e18957c | |
parent | 5e55c02bc61278bb4ca3bed9e4f3fb9efe223fb6 (diff) | |
download | bun-42f61ebf8ac560dbfb356fd276494ced58ce7dc8.tar.gz bun-42f61ebf8ac560dbfb356fd276494ced58ce7dc8.tar.zst bun-42f61ebf8ac560dbfb356fd276494ced58ce7dc8.zip |
cleanup error printing
-rw-r--r-- | src/cli.zig | 4 | ||||
-rw-r--r-- | src/install/install.zig | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/cli.zig b/src/cli.zig index 152661eff..d6c83d3ce 100644 --- a/src/cli.zig +++ b/src/cli.zig @@ -308,8 +308,10 @@ pub const Arguments = struct { .allocator = allocator, }) catch |err| { // Report useful error and exit + clap.help(Output.errorWriter(), ¶ms) catch {}; + Output.errorWriter().writeAll("\n") catch {}; diag.report(Output.errorWriter(), err) catch {}; - return err; + Global.exit(1); }; if (args.flag("--version")) { diff --git a/src/install/install.zig b/src/install/install.zig index 842a44b40..ea555eb5d 100644 --- a/src/install/install.zig +++ b/src/install/install.zig @@ -3401,7 +3401,8 @@ pub const PackageManager = struct { .diagnostic = &diag, .allocator = allocator, }) catch |err| { - // Report useful error and exit + clap.help(Output.errorWriter(), params) catch {}; + Output.errorWriter().writeAll("\n") catch {}; diag.report(Output.errorWriter(), err) catch {}; return err; }; |