-
-
Notifications
You must be signed in to change notification settings - Fork 97
Question on error-stack #175
-
Hi!
I was looking at libraries that use error-stack to see if there’s anything we can learn about what to improve. I came across this and noticed that you recently switched back from error-stack to anyhow. Was there anything specific that factored into that decision? We are constantly trying to improve the crate (and in the very near future we will also release error-stack@v0.2) and any feedback, good or bad, is very helpful, especially if you ran into problems!
Thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions
error-stack shake up error handling as it allows me to think of possible error paths more thoroughly and think of error messages in a by-level-of-abstraction way. For a bonus, it is easy to attach arbitrary objects in error.
However, I moved back to anyhow as most of the time, creating a by-level-of-abstraction error message is not very important and could have some development overhead, especially when thinking of an error struct/enum name or when to change context. Additionally, it could hinder readability (at least for me), especially if there are a lot of lines that early return an error that does not return a Report directly, having to call report() manually for each line.
In general e...
Replies: 1 comment 1 reply
-
error-stack shake up error handling as it allows me to think of possible error paths more thoroughly and think of error messages in a by-level-of-abstraction way. For a bonus, it is easy to attach arbitrary objects in error.
However, I moved back to anyhow as most of the time, creating a by-level-of-abstraction error message is not very important and could have some development overhead, especially when thinking of an error struct/enum name or when to change context. Additionally, it could hinder readability (at least for me), especially if there are a lot of lines that early return an error that does not return a Report directly, having to call report() manually for each line.
In general error-stack is indeed helpful. What I like the most is how it prints the error messages and the line where the context was changed, but its benefit can also be a disadvantage if the by-level-of-abstraction errors are not very important. Nonetheless, I could see it being very useful on other projects.
Beta Was this translation helpful? Give feedback.
All reactions
-
Thank you very much for your feedback, very appreciative!
Beta Was this translation helpful? Give feedback.
All reactions
-
😄 1