I've seen it used before but I'm not certain what problem it solves. Can you elaborate?
-
-
-
Basically, if you would otherwise use Box<Error>, then anyhow::Error is a better version of that. It has backtraces for example, and will correctly print causal chains. It also has nice convenience constructors.
- 6 more replies
New conversation -
-
-
I remember time when
@burntsushi5 recommended to use Error trait over error crates. Back then it was hard to me to accept that since the trait was cumbersome. Now when error trait got simplified and I finally feel comfortable using it@burntsushi5 praises an error crate. :) -
The error trait simplifications don't really do much. The only thing you don't need to write now is the description method. But you never really needed it in the first place. :) cause was deprecated, but it was replaced with source.
End of conversation
New conversation -
-
-
I see that your blog post now recommend it over 'failure'. How is it better? Is it lighter?
-
failure is effectively unmaintained and doesn't integrate as well with the Error trait.
- 1 more reply
New conversation -
-
-
I just discovered it this evening and
it. I think it should make it to the std library.Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I've also picked up thiserror for when I do need structured errors. Having #[from] for conversions is great, and it pairs well with anyhow!
-
They are from the same person.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.