diff options
author | 2023-07-28 18:53:44 -0700 | |
---|---|---|
committer | 2023-07-28 18:53:44 -0700 | |
commit | 4f914cbfe805e3f48f2614e7dc30ae80bc3fb604 (patch) | |
tree | ca1a4b5b375a8d47a79503ea07a17ee670b9d4dc /src/output.zig | |
parent | da7c1d84e924ce3c80c453eecd88c06e58b0c1d7 (diff) | |
download | bun-4f914cbfe805e3f48f2614e7dc30ae80bc3fb604.tar.gz bun-4f914cbfe805e3f48f2614e7dc30ae80bc3fb604.tar.zst bun-4f914cbfe805e3f48f2614e7dc30ae80bc3fb604.zip |
Ignore when printing to stdout errors (#3869)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to '')
-rw-r--r-- | src/output.zig | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/output.zig b/src/output.zig index cffa2c414..0f9b1d67c 100644 --- a/src/output.zig +++ b/src/output.zig @@ -402,10 +402,11 @@ pub noinline fn print(comptime fmt: string, args: anytype) void { if (comptime Environment.allow_assert) std.debug.assert(source_set); + // There's not much we can do if this errors. Especially if it's something like BrokenPipe. if (enable_buffering) { - std.fmt.format(source.buffered_stream.writer(), fmt, args) catch unreachable; + std.fmt.format(source.buffered_stream.writer(), fmt, args) catch {}; } else { - std.fmt.format(writer(), fmt, args) catch unreachable; + std.fmt.format(writer(), fmt, args) catch {}; } } } @@ -664,6 +665,7 @@ pub noinline fn printError(comptime fmt: string, args: anytype) void { source.error_stream.writer().print(fmt, args) catch unreachable; root.console_error(root.Uint8Array.fromSlice(source.err_buffer[0..source.error_stream.pos])); } else { + // There's not much we can do if this errors. Especially if it's something like BrokenPipe if (enable_buffering) std.fmt.format(source.buffered_error_stream.writer(), fmt, args) catch {} else |