Change many "orelse return" sections to log.err

Beansprout will still continue gracefully, but I added handling so that
they'll log errors so we should have some record of something beind
wrong.
This commit is contained in:
Ben Buhse 2026-02-08 15:11:03 -06:00
commit 4d379a272c
No known key found for this signature in database
GPG key ID: 7916ACFCD38FD0B4
4 changed files with 37 additions and 15 deletions

View file

@ -295,7 +295,7 @@ fn wallpaperLayerSurfaceListener(layer_surface: *zwlr.LayerSurfaceV1, event: zwl
output.configured = true;
output.renderWallpaper() catch |err| {
fatal("Wallpaper render failed: E{}", .{err});
log.err("Wallpaper render failed: {}", .{err});
};
},
.closed => {
@ -334,7 +334,7 @@ pub fn renderWallpaper(output: *Output) !void {
return;
}
// Scale our loaded image and then copy it into the Buffer's pixman.Image
const wallpaper_image = context.wallpaper_image orelse return;
const wallpaper_image = context.wallpaper_image orelse return error.MissingWallpaperImage;
const image = wallpaper_image.image;
const image_data = image.getData();
const image_width = image.getWidth();
@ -559,7 +559,6 @@ fn calculatePrimaryStackLayout(output: *Output) void {
const std = @import("std");
const assert = std.debug.assert;
const fatal = std.process.fatal;
const mem = std.mem;
const DoublyLinkedList = std.DoublyLinkedList;