Derive Macro phper::Throwable[][src]

#[derive(Throwable)]
{
    // Attributes available to this derive:
    #[throwable]
    #[throwable_class]
    #[throwable_crate]
}
Expand description

Auto derive for phper::errors::Throwable.

Examples

#[derive(thiserror::Error, crate::Throwable, Debug)]
#[throwable(class = "Exception")]
pub enum Error {
    #[error(transparent)]
    Io(#[from] std::io::Error),

    #[error(transparent)]
    #[throwable(transparent)]
    My(#[from] MyError),
}

TODO Support attribute throwable with code and message, integration tests.