A structured error returned by Linx.Seccomp operations.
Used for two distinct classes of failure:
Caller-side build failures from
Linx.Seccomp.from_rules/1/allow_list/2/deny_list/2/Linx.Seccomp.Builder.build/1—:operationis:build. Most build failures use tagged tuples ({:error, {:unknown_syscall, _}},{:error, {:bad_action, _}},{:error, {:duplicate_rule, _}},{:error, {:unsupported_arch, _}}); the struct is the home for build failures that don't fit those categories (notably:errno:e2bigfor filters that overflow the 255-instruction jump limit; trampoline-based splitting is deferred).Kernel-side install failures from
Linx.Seccomp.install/2that come back throughLinx.Processas{:linx_process, :error, errno, stage}where stage is:seccomp_installor:seccomp_no_new_privs. The struct is used to normalise those errno-bearing tuples for callers that prefer one error type.:operationis:installor:set_no_new_privs.
Fields
:operation— what we were trying to do, as an atom::build|:install|:set_no_new_privs.:errno— a POSIX errno as an atom (:einval,:eperm, …), or a Linx-specific atom (:e2bigfor the jump-overflow build failure) when nothing in the POSIX table fits.:code— the matching positive errno integer, ornilfor atoms outside the POSIX table.
Implements Exception, so an error can be raised or rendered
with Exception.message/1.
Summary
Functions
Builds a %Linx.Seccomp.Error{} from an errno atom and the
operation that failed.
Types
@type operation() :: :build | :install | :set_no_new_privs
@type t() :: %Linx.Seccomp.Error{ __exception__: true, code: pos_integer() | nil, errno: atom(), operation: operation() }