tracerr

Latest version License Unsafe forbidden Rust docs

API Docs | Changelog

Custom compile time captured error tracing for [Rust].

Usage

The common rule: - Use macro to capture trace frame in the invocation place.

```rust use tracerr::Traced;

let err = tracerr::new!("my error"); // captures frame

let res: Result<(), > = Err(err) .maperr(tracerr::wrap!()); // captures frame

let err: Traced<&'static str> = res.unwraperr(); asserteq!( format!("{}\n{}", err, err.trace()), r"my error error trace: rustout at src/lib.rs:6 rustout at src/lib.rs:9", );

let (val, trace) = err.intoparts(); asserteq!( format!("{}\n{}", val, trace), r"my error error trace: rustout at src/lib.rs:6 rustout at src/lib.rs:9", ); ```

License

Copyright © 2019 Instrumentisto Team, https://github.com/instrumentisto

This software is subject to the terms of the Blue Oak Model License 1.0.0. If a copy of the BlueOak-1.0.0 license was not distributed with this file, You can obtain one at https://blueoakcouncil.org/license/1.0.0.