pub enum Error {
Show 19 variants
NotPermitted(String),
PathNotAllowed(String),
HostNotAllowed(String),
Timeout(Duration),
Process(String),
ProcessExit {
code: i32,
message: String,
},
Filesystem(String),
Network(String),
Format(String),
Environment(String),
ModuleNotAvailable(String),
InvalidArgument(String),
Io(Error),
Host(Error),
Internal(String),
TerminalUI(String),
K8s(String),
InvalidValue(String),
Serialization(String),
}Expand description
Errors that can occur during stdlib operations.
Variants§
NotPermitted(String)
Operation not permitted by safety config.
PathNotAllowed(String)
Path not in allowlist.
HostNotAllowed(String)
Host not in allowlist.
Timeout(Duration)
Operation timed out.
Process(String)
Process execution failed.
ProcessExit
Process exit with non-zero code.
Filesystem(String)
Filesystem error.
Network(String)
Network error.
Format(String)
Format error.
Environment(String)
Environment error.
ModuleNotAvailable(String)
Module not available.
InvalidArgument(String)
Invalid argument.
Io(Error)
IO error.
Host(Error)
Host error.
Internal(String)
Internal error.
TerminalUI(String)
Terminal UI error.
K8s(String)
Kubernetes error.
InvalidValue(String)
Invalid value error.
Serialization(String)
Serialization error.
Implementations§
Source§impl Error
impl Error
Sourcepub fn not_permitted(msg: impl Into<String>) -> Self
pub fn not_permitted(msg: impl Into<String>) -> Self
Create a not permitted error.
Sourcepub fn path_not_allowed(path: impl Into<String>) -> Self
pub fn path_not_allowed(path: impl Into<String>) -> Self
Create a path not allowed error.
Sourcepub fn host_not_allowed(host: impl Into<String>) -> Self
pub fn host_not_allowed(host: impl Into<String>) -> Self
Create a host not allowed error.
Sourcepub fn process_exit(code: i32, message: impl Into<String>) -> Self
pub fn process_exit(code: i32, message: impl Into<String>) -> Self
Create a process exit error.
Sourcepub fn filesystem(msg: impl Into<String>) -> Self
pub fn filesystem(msg: impl Into<String>) -> Self
Create a filesystem error.
Sourcepub fn invalid_argument(msg: impl Into<String>) -> Self
pub fn invalid_argument(msg: impl Into<String>) -> Self
Create an invalid argument error.
Sourcepub fn is_safety_error(&self) -> bool
pub fn is_safety_error(&self) -> bool
Check if this is a safety-related error.
Sourcepub fn is_timeout(&self) -> bool
pub fn is_timeout(&self) -> bool
Check if this is a timeout error.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more