This post provides a guide/tutorial from what I learn't from one of my projects on how to wrap errors with enums when using the error stack crate in rust.
Blog Post: How To Wrap Your Errors With Enums When Using Error-Stack
https://betterprogramming.pub/how-to-wrap-your-errors-with-enums-when-using-error-stack-77b122016e6e
4 Comments
SorteKanin@feddit.dk · 2 pts · 3y
I guess what I don't really understand still is what advantage this provides over something like anyhow.
snaggen@programming.dev · 1 pts · 3y
Error stack will give will print the full stack of errors and their corresponding line in the code. Much like a backtrace, but for errors.
SorteKanin@feddit.dk · 2 pts · 3y
Doesn't anyhow also give a stack of errors? Although not with lines, that does sound useful.
snaggen@programming.dev · 1 pts · 3y
You are right, it does. But as you say, it seems more limited in that aspect than error-stack from a first glance.