summaryrefslogtreecommitdiff
path: root/pkg/wuffs/src/error.zig
blob: c75188718a9215ba6ef0f44b32ce2ff63197dbc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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;
    }
}