Macro homestar_invocation::bail
source · macro_rules! bail { ($e:expr) => { ... }; }
Expand description
Return early with an error.
Modelled after anyhow::bail.
Example
use homestar_invocation::{bail, Error, Unit};
fn has_permission(user: usize, resource: usize) -> bool {
true
}
if !has_permission(user, resource) {
bail!(Error::Unknown);
}