shepmaster / snafu

Easily assign underlying errors into domain-specific errors while adding context
https://docs.rs/snafu/
Apache License 2.0
1.4k stars 60 forks source link

Error reporter in SNAFU #354

Closed YjyJeff closed 1 year ago

YjyJeff commented 1 year ago

According to the Error handling project, they recommend using the error reporter to report the error and

An error type with a source error should either return that error via source or include that source's error message in its own Display output, but never both.

Does SNAFU have the error reporter that can print the Error in multiple lines like anyhow ?

// Outputs
// Error: outermost error: second error: root error
//
// Caused by:
//    0: second error: root error
//    1: root error
shepmaster commented 1 year ago

I happen to be working on that at the moment (#355) so it should be available in SNAFU 0.7.2 🤞. Please feel free to skim the docs in that PR and provide feedback.

YjyJeff commented 1 year ago

Looking forward to it!