Error Handling
Defining an error
// in std/mem/Allocator.zig
pub const Error = error{
OutOfMemory,
};
// in std/io.zig
pub const NoEofError = ReadError || error{
EndOfStream,
};
// in std/dynamic_library.zig
const ElfDynLibError = error{
FileTooBig,
NotElfFile,
NotDynamicLibrary,
MissingDynamicLinkingInformation,
ElfStringSectionNotFound,
ElfSymSectionNotFound,
ElfHashTableNotFound,
} || posix.OpenError || posix.MMapError;Returning errors
Handling errors
Last updated