Enum Error

Source
pub enum Error {
Show 20 variants NixError, UnknownError, CreatePipe(i32), Fork(i32), Exec(i32), Chdir(i32), ParentDeathSignal(i32), PipeError(i32), WaitError(i32), StdioError(i32), SetUser(i32), ChangeRoot(i32), SetIdMap(i32), AuxCommandExited(i32), AuxCommandKilled(i32), SetPGid(i32), SetNs(i32), CapSet(i32), BeforeUnfreeze(Box<dyn Error + Send + Sync + 'static>), PreExec(i32),
}
Expand description

Error runnning process

This type has very large number of options and it’s enum only to be compact. Probably you shouldn’t match on the error cases but just format it for user into string.

Variants§

§

NixError

Unknown nix error

Frankly, this error should not happen when running process. We just keep it here in case nix returns this error, which should not happen.

§

UnknownError

Some invalid error code received from child application

§

CreatePipe(i32)

Error happened when we were trying to create pipe. The pipes used for two purposes: (a) for the process’s stdio (Stdio::pipe() or Stdio::null()), (b) internally to wake up child process and return error back to the parent.

§

Fork(i32)

Error when forking/cloning process

§

Exec(i32)

Error when running execve() systemcall

§

Chdir(i32)

Error when setting working directory specified by user

§

ParentDeathSignal(i32)

Unable to set death signal (probably signal number invalid)

§

PipeError(i32)

Error reading/writing through one of the two signal pipes

§

WaitError(i32)

Error waiting for process (for some functions only, for example Command::status()). It probably means someone already waited for the process, for example it might be other thread, or signal handler.

§

StdioError(i32)

Error setting up stdio for process

§

SetUser(i32)

Could not set supplementary groups, group id or user id for the process

§

ChangeRoot(i32)

Error changing root, it explains chroot, pivot_root system calls and setting working directory inside new root. Also includes unmounting old file system for pivot_root case.

§

SetIdMap(i32)

Error setting uid or gid map. May be either problem running newuidmap/newgidmap command or writing the mapping file directly

§

AuxCommandExited(i32)

Auxillary command failed

There are two auxillary commands for now: newuidmap and newgidmap. They run only when uid mappings (user namespaces) are enabled.

Note that failing to run the binary results to SedIdMap(sys_errno), this error contains status code of command that was succesfullly spawned.

§

AuxCommandKilled(i32)

Auxillary command was killed by signal

Similar to AuxCommandExited but when command was killed

§

SetPGid(i32)

Error when calling setpgid function

§

SetNs(i32)

Error when calling setns syscall

§

CapSet(i32)

Error when calling capset syscall

§

BeforeUnfreeze(Box<dyn Error + Send + Sync + 'static>)

Before unfreeze callback error

§

PreExec(i32)

Before exec callback error

Implementations§

Source§

impl Error

Source

pub fn raw_os_error(&self) -> Option<i32>

Similarly to io::Error returns bare error code

Trait Implementations§

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Error

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.