macro_rules! create_error {
    ( $error:ident => $( $error_reason:ident ),* ) => { ... };
}
Expand description

Defining an error with set of reason.

Usage

create_error!(ErrorType => ErrorReason1, ErrorReason2, ErrorReason3)

Examples

use error_ex::{create_error, map_to_error};

create_error!(InputError => IllegalArgument, InvalidInput, MissingArgument);

Now, you can use the following code to instantiate this error

InputError::IllegalArgument(format!("Your message here"))