ebacktrace
Welcome to ebacktrace
🎉
This crate implements a simple error wrapper which captures a backtrace upon creation and can carry an optional textual description of the error.
Example
extern crate ebacktrace;
/// The error kind
// Define our custom error type
define_error!;
/// A function that will always fail
// Will panic with a nice fully-backtraced error
will_fail.unwrap;
Features
This crate currently has two feature gates:
force_backtrace
(enabled by default): UseBacktrace::force_capture
(instead ofBacktrace::capture
) to always capture a backtrace regardless whetherRUST_BACKTRACE
is set or not.derive_display
(enabled by default): Use theDisplay
-trait forEtrace<MyType>
using theDebug
representation ofMyType
(instead of theDisplay
representation). This way you can pretty-print the underlying error types without the necessity to manually implement theDisplay
-trait for them.