Skip to main content
Zinc functions return 0 on success and negative POSIX error codes on failure. Language adapters translate these into native error types: Rust returns Result<T, ZincError>, Python raises OSError, Go returns error, and other languages throw exceptions.

Error enum

The Rust core defines a ZincError enum with these variants:

Error by scenario

When you encounter an error during development, this table can help identify the cause:

Error handling examples

Platform errors

Any system call can produce an OS-level error. Mapping calls use ZincError::Syscall { syscall, source }. The error code returned to the caller is the negated OS error code. Common platform errors: Check return values during development. In production, handle at least AlreadyExists (fall back to open), NotFound (retry or log), and TimedOut (treat as a heartbeat miss). Syscall { syscall, source } preserves the syscall name and operating-system error in Rust. The C ABI returns the negative errno. Permission failures from shm_open use PermissionDenied (-1).