Skip to main content

ShellErrorExt

Trait ShellErrorExt 

Source
pub trait ShellErrorExt {
    // Required methods
    fn into_inner(self) -> Result<ShellError>;
    fn into_labeled(self) -> Result<LabeledError>;
    fn generic_error(self) -> Result<String>;
    fn generic_msg(self) -> Result<String>;
}
Expand description

Extensions for interrogating ShellError values in tests.

Required Methods§

Source

fn into_inner(self) -> Result<ShellError>

Tries to convert into an inner value from a ShellError.

Useful if the error is expected to be a generic error that contains an inner error or a chained error that chained another error.

However, this function returns None

So make sure that a None value is not surprise.

Source

fn into_labeled(self) -> Result<LabeledError>

Extract the LabeledError from ShellError::LabeledError, if it is one.

Source

fn generic_error(self) -> Result<String>

Extract the error field from ShellError::Generic, if it is one.

Source

fn generic_msg(self) -> Result<String>

Extract the message field from ShellError::Generic, if it is one.

Implementations on Foreign Types§

Source§

impl ShellErrorExt for ShellError

Implementors§