failure
failure copied to clipboard
[FEATURE REQUEST] Add ability to `bail!` and `ensure!` error types.
Today u can only bail! and ensure! error message (&str).
I suggest adding the ability to return structs and enums that implement Fail trait.
Today:
bail!("error message");
ensure!(false, "error message");
Could be:
bail!(ErrorKind::SomeError);
ensure!(false, ErrorKind::SomeError);