Skip to content

Commit

Permalink
add more error catching
Browse files Browse the repository at this point in the history
  • Loading branch information
BrookJeynes committed May 24, 2024
1 parent f370869 commit 95ee082
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ pub fn main() !void {
var image: ?vaxis.Image = null;
var path: [std.fs.max_path_bytes]u8 = undefined;
var last_path: [std.fs.max_path_bytes]u8 = undefined;
var was_error: bool = false;

try view.populate();
view.populate() catch {
was_error = true;
};

vx = try vaxis.init(alloc, .{});
defer vx.deinit(alloc);
Expand All @@ -56,7 +59,6 @@ pub fn main() !void {

var last_pressed: ?vaxis.Key = null;
var last_known_height: usize = vx.window().height;
var was_error: bool = false;
while (true) {
const event = loop.nextEvent();

Expand Down

0 comments on commit 95ee082

Please sign in to comment.