erreport

A Result helper to catch all the Err propagation path

Why?

When an Err propagated, we need a method catch all the propagation path.

So we can get this report in release mode with debug=0: {package0@version0} src/lib.rs:56 -> src/xx.rs:23 -> {package1@version1} src/lib.rs:42 -> src/yy.rs:632 -> src/zz.rs:56 -> {package2@version2} src/lib.rs:251 -> InvalidXXX

How to use

``rust // This will generate a trait calledpub(crate) trait ToReportto help to convert anyResulttoReport`. // You just need to call once for each crate. erreport::gentraitto_report!();

fn test() -> Result<(), erreport::Report> { anyresultimplstderrorError.toreport()?; anyresultimplstderrorError.toreport()?; Ok(()) } ```

How to access the actual Error?

rust fn main() { if let Err(err) = test() { // This method will bypass all the `Report` wrappers and get the first actual `Error` value. err.source() } }