Struct clierr::Error [] [src]

pub struct Error { /* fields omitted */ }

A minimalist error type to use in CLI scripts: it wraps an arbitrary cause which implements std::error::Error and a description for the Display implementation.

Methods

impl Error
[src]

Creates a new Error with a description and a cause.

In most cases you'll want to use the convenient DescribeErr trait or the ctry and ccheck macros.

With a &'static str:

Error::new("oh no!", some_error);

With a String:

Error::new(format!("should not have tried to open '{}'!", filename), some_error);

Creates a new error with a descrption but no cause. Useful for validation specific errors where there's no underlying error (e.g. CLI timeout argument must be greater than zero).

Creates a new error with a cause, but no description. The Display implementation forwards to that of cause in this case.

In most cases you'll want to use the convenient DescribeErr trait or the ctry and ccheck macros instead.

Trait Implementations

impl Debug for Error
[src]

Formats the value using the given formatter.

impl Display for Error
[src]

Formats the value using the given formatter. Read more

impl StdError for Error
[src]

A short description of the error. Read more

The lower-level cause of this error, if any. Read more