Macro human_errors::error_shim
source · [−]macro_rules! error_shim {
($type:ident) => { ... };
}Expand description
Create a shim error type between [human_errors::Error] and other error types.
Examples
human_errors::error_shim!(MyError);
impl From<std::num::ParseIntError> for MyError {
fn from(err: std::num::ParseIntError) -> Self {
user_with_internal(
"We could not parse the number you provided.",
"Make sure that you're providing a number in the form 12345 or -12345.",
err,
)
}
}