I am an intermediate Rust developer, and you may know me from my posts on subreddits like r/opensource or r/rust or from my various projects on GitHub.
Recently, we decided to do error handling and provide custom error messages for the errors related to each engine code present under the src/engines folder in one of my projects, when using error stack. We wanted to use enums for it, and we found that the error-stack project provided no guide, tutorial, or examples. But one of our maintainers provided a cool solution to this problem that helped me learn much, so I decided to share it with you all. You’ll learn how you can wrap errors with enums when using an error stack, so stick around until the end of the article.