diff --git a/src/api/services/actors.zig b/src/api/services/actors.zig index f35e9e0..0244336 100644 --- a/src/api/services/actors.zig +++ b/src/api/services/actors.zig @@ -154,8 +154,11 @@ pub fn get(db: anytype, id: Uuid, alloc: std.mem.Allocator) GetError!Actor { .{id}, alloc, ) catch |err| switch (err) { - error.NoRows => error.NotFound, - else => error.DatabaseFailure, + error.NoRows => return error.NotFound, + else => |e| { + std.log.err("{}, {?}", .{ e, @errorReturnTrace() }); + return error.DatabaseFailure; + }, }; } diff --git a/src/sql/lib.zig b/src/sql/lib.zig index 0eaf206..a3a900c 100644 --- a/src/sql/lib.zig +++ b/src/sql/lib.zig @@ -304,8 +304,8 @@ const Row = union(Engine) { fn get(self: Row, comptime T: type, idx: u15, alloc: ?Allocator) common.GetError!T { if (T == void) return; return switch (self) { - .postgres => |pg| pg.get(T, idx, alloc), - .sqlite => |lite| lite.get(T, idx, alloc), + .postgres => |pg| try pg.get(T, idx, alloc), + .sqlite => |lite| try lite.get(T, idx, alloc), }; } };