Macro human_panic::setup_panic[][src]

macro_rules! setup_panic {
    ($meta:expr) => { ... };
    () => { ... };
}

human-panic initialisation macro

You can either call this macro with no arguments setup_panic!() or with a Metadata struct, if you don't want the error message to display the values used in your Cargo.toml file.

The Metadata struct can't implement Default because of orphan rules, which means you need to provide all fields for initialisation.

This example is not tested
#[macro_use]
extern crate human_panic;

setup_panic!(Metadata {
    name: env!("CARGO_PKG_NAME").into(),
    version: env!("CARGO_PKG_VERSION").into(),
    authors: "My Company Support <support@mycompany.com".into(),
    homepage: "support.mycompany.com".into(),
});