Skip to content

multiple error types (struct and enum) and generic IntoError #419

Answered by nerditation
nerditation asked this question in Q&A
Discussion options

You must be logged in to vote

most of my errors have a single type as source

This is a big point the point of SNAFU and a major reason it was created; note how the example in the README essentially mirrors yours.

oh, great, I must have read the example in the README looooooong time ago and forgot about it. it indeed is almost the same as my case.

so I attempt to rewrite it

The big missing thing for me here is why?

maybe it's just a personal tastes. in my case, because the git2::Error type already conveys very rich information in it, all I really need is a way to tell me where things went wrong, Location is very handy, but it alone is not enough for me. in fact, I can almost get away with Whatever in most cases…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by shepmaster
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
Converted from issue

This discussion was converted from issue #411 on November 29, 2023 21:33.