3 ms·
Yes, and you can even handle some errors, and then capture an error whose type is the subset of unhandled errors, and return that, limiting the error set of the
by AndyKelley 5y ago
Yes, and you can even handle some errors, and then capture an error whose type is the subset of unhandled errors, and return that, limiting the error set of the current function to not include the handled ones. Here are a couple examples: https://github.com/ziglang/zig/blob/7d0de54ad44832589379a4bcbba493db2087bebf/src/Module.zig#L2327-L2355 https://github.com/ziglang/zig/blob/7d0de54ad44832589379a4bc...
You get compile errors if you try to handle an impossible error, or don't include an `else` prong (in which case the compiler tells you the full set of unhandled errors).
- Zababa 5y agoThat's a great feature. I'm constantly impressed by what Zig can do.