Function nagiosplugin::safe_run[][src]

pub fn safe_run<F: Fn() -> Result<(), Box<dyn Error>>>(closure: F)

Runs the given closure and exits with a State::Critical after printing out the error message if the Result contains an Err.