Skip to content

How to map one source Error type to different SNAFU Error variants? #402

Answered by 8573
dominickpastore asked this question in Q&A
Discussion options

You must be logged in to vote

The first almost seems like it would work, except if there's an implicitly-generated backtrace or Location in the SNAFU error (which I'd really like to have—it's the main reason I'm adopting SNAFU), I'd expect it to take them from inside the From impl instead of at the site where the error result actually happened.

Would applying #[track_caller] to the fn from help?

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@dominickpastore
Comment options

@dominickpastore
Comment options

Answer selected by dominickpastore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants