Error Union

Noun · Development

Definitions

  1. A Zig language type that combines a normal return type with a set of possible error values, forcing callers to handle errors explicitly. Written as !T or ErrorSet!T.

    In plain English: A return type in Zig that says 'this gives you either the result you want OR an error' — and the compiler won't let you ignore the error.

    Example: "The function returns FileOpenError!File — you must handle the error before you can use the file handle."

Related Terms