Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Question on error-stack #175

Answered by SeaDve
TimDiekmann asked this question in Q&A
Discussion options

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!

You must be logged in to vote

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

Comment options

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.

You must be logged in to vote
1 reply
Comment options

Thank you very much for your feedback, very appreciative!

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

AltStyle によって変換されたページ (->オリジナル) /