~subsetpark/erasmus

b8d292340fd0b390cdc9e8ef44c6a5e3d1dc6253 — Zach Smith 2 months ago 0deae02 master
Streamline error output
1 files changed, 4 insertions(+), 8 deletions(-)

M src/main.zig
M src/main.zig => src/main.zig +4 -8
@@ 33,18 33,14 @@ fn readBody(entry_name: []const u8, contents: *util.CharBuffer) !void {
    while (true) {
        var buf: [max_line_length]u8 = undefined;
        var maybe_line = util.nextLine(reader, &buf) catch |err| {
            std.debug.print("[{s}] Read error. ", .{entry_name});
            switch (err) {
                error.StreamTooLong => {
                    std.debug.print(
                        "[{s}] Read error. Maximum line length: {d}\n",
                        .{ entry_name, max_line_length },
                    );
                    return err;
                },
                else => {
                    return err;
                    std.debug.print("Maximum line length: {d}\n", .{max_line_length});
                },
                else => {},
            }
            return err;
        };
        if (maybe_line) |line| {
            if (line.len > util.ref_prefix.len and mem.eql(