cleanup error printing

This commit is contained in:
Jarred Sumner
2022-03-02 03:07:28 -08:00
parent 5e55c02bc6
commit 42f61ebf8a
2 changed files with 5 additions and 2 deletions

View File

@@ -308,8 +308,10 @@ pub const Arguments = struct {
.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;
Global.exit(1);
};
if (args.flag("--version")) {

View File

@@ -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;
};