diff options
| author | Jeffrey C. Ollie <jeff@ocjtech.us> | 2025-01-01 00:03:29 -0600 |
|---|---|---|
| committer | Jeffrey C. Ollie <jeff@ocjtech.us> | 2025-01-01 22:48:30 -0600 |
| commit | 652079b26ccb7d76fbc6726f04b40bb3552db06c (patch) | |
| tree | 1b194f40676be5a4a089ca0c71a511da2d68d8dd /pkg/wuffs/src/error.zig | |
| parent | 94599102e9fb8247af08cbbbcb7ee25e3d31e1bd (diff) | |
wuffs: update, add jpeg decoding, add simple tests
Diffstat (limited to 'pkg/wuffs/src/error.zig')
| -rw-r--r-- | pkg/wuffs/src/error.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/wuffs/src/error.zig b/pkg/wuffs/src/error.zig index 609deec9c..c75188718 100644 --- a/pkg/wuffs/src/error.zig +++ b/pkg/wuffs/src/error.zig @@ -1,3 +1,13 @@ const std = @import("std"); +const c = @import("c.zig").c; + pub const Error = std.mem.Allocator.Error || error{WuffsError}; + +pub fn check(log: anytype, status: *const c.struct_wuffs_base__status__struct) error{WuffsError}!void { + if (!c.wuffs_base__status__is_ok(status)) { + const e = c.wuffs_base__status__message(status); + log.warn("decode err={s}", .{e}); + return error.WuffsError; + } +} |
