pub enum CliError {
Parse(ParseError),
NoHandler(String),
Handler(Box<dyn Error + Send + Sync>),
}Expand description
Errors produced by Cli::run.
Variants§
Parse(ParseError)
A parse error occurred (unknown command, missing argument, etc.).
When this variant is returned, Cli::run also prints the error and
best-effort help to stderr before returning.
NoHandler(String)
The matched command has no handler registered.
The inner String is the canonical name of the command.
Handler(Box<dyn Error + Send + Sync>)
The registered handler returned an error.
The inner boxed error carries the handler’s error message.
Trait Implementations§
Source§impl Error for CliError
impl Error for CliError
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()
Source§impl From<ParseError> for CliError
impl From<ParseError> for CliError
Source§fn from(source: ParseError) -> Self
fn from(source: ParseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CliError
impl !RefUnwindSafe for CliError
impl Send for CliError
impl Sync for CliError
impl Unpin for CliError
impl UnsafeUnpin for CliError
impl !UnwindSafe for CliError
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