added eof error since read does not raise errors for it
This commit is contained in:
parent
f97456aab8
commit
5ef9f52d95
2 changed files with 12 additions and 1 deletions
|
@ -65,5 +65,12 @@ pub fn main() !void {
|
|||
defer thread_manager.deinit();
|
||||
|
||||
var f = std.io.getStdIn();
|
||||
try input.main_loop(f, buffs, &thread_manager, std.heap.page_allocator);
|
||||
input.main_loop(f, buffs, &thread_manager, std.heap.page_allocator) catch |err| {
|
||||
switch (err) {
|
||||
util.Errors.EOFError => {
|
||||
return;
|
||||
},
|
||||
else => return err,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
const std = @import("std");
|
||||
|
||||
pub const Errors = error{
|
||||
EOFError,
|
||||
};
|
||||
|
||||
pub const Options = struct {
|
||||
width: usize,
|
||||
height: usize,
|
||||
|
|
Loading…
Reference in a new issue