A lightweight library for displaying errors and their sources.
A sample output:
```rust macrorules! implerror { // ... # }
// TopLevel
is caused by a MidLevel
.
struct TopLevel; impl_error!(TopLevel, "top level", Some(&MidLevel));
// MidLevel
is caused by a LowLevel
.
struct MidLevel; impl_error!(MidLevel, "mid level", Some(&LowLevel));
// LowLevel
is the cause itself.
struct LowLevel; impl_error!(LowLevel, "low level", None);
// Now let's see how it works: let formatted = displayerrorchain::DisplayErrorChain::new(&TopLevel).tostring(); asserteq!( formatted, "\ top level Caused by: -> mid level -> low level" ); ```
License: Apache-2.0/MIT