backtrait_error 1.0.0

Errors with backtraces.
Documentation

Backtrace/Backtrait Error

Procedural macros to aid the propagation of Backtraces between structs/enums (typically errors).

Dunno if it'd be useful yet.

Gist

Provides a function-like procedural macro to generate a simple trait for facilitating propagating backtraces. The trait is defined where the macro is called. See below.

define_backtrace_error!(ErrorWithBacktrace); // Expands into `pub trait ErrorWithBacktrace: std::error::Error {`...

Provides an attribute procedural macro to derive a simple std::error::Error implementation for structs/enums. See below.

#[backtrace_derive(ErrorWithBacktrace)]
#[derive(Debug, BacktraceError)]
struct UnitError(#[display] String, #[backtrace] Backtrace);