Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

renderToStderr

ErrorBundle.renderToStderr
pub fn renderToStderr(eb: ErrorBundle, io: Io, options: RenderOptions, color: std.zig.Color) RenderToStderrError!void

File

lib/std/zig/ErrorBundle.zig:168

Code

pub fn renderToStderr(eb: ErrorBundle, io: Io, options: RenderOptions, color: std.zig.Color) RenderToStderrError!void {
    var buffer: [256]u8 = undefined;
    const stderr = try io.lockStderr(&buffer, color.terminalMode());
    defer io.unlockStderr();
    renderToTerminal(eb, options, stderr.terminal()) catch |err| switch (err) {
        error.WriteFailed => return stderr.file_writer.err.?,
        else => |e| return e,
    };
}