15 ms·
Are you familiar with Zig's error handling? Except for the fact that errors cannot contain payloads, it is, imo, perfect.
by dilap 6y ago
Are you familiar with Zig's error handling? Except for the fact that errors cannot contain payloads, it is, imo, perfect.
- jiehong 6y agoit has the same issues. You can always discard errors with `catch unreachable` for example.
- malcolmstill 6y agoOf all the absolutely fantastic stuff that Zig gets right, I think my favourite is the error handling. While it would be cool to get an error payload, I would hope that if that was added to the language, that it doesn't affect the current ergonomics of error handling. Where I've really needed to get some data back out, I've passed in a pointer to a struct that gets populated.