3 ms·
I've used `thiserror` with great success in small side web projects since you can create a new enum of Errors that can be converted from a class of underling li
by status_quo69 6y ago
I've used `thiserror` with great success in small side web projects since you can create a new enum of Errors that can be converted from a class of underling library errors. Then, inside of my regular application code, I sprinkle in `anyhow` to make my life easier.
For example, if I wanted to say, return a 500 status code for all diesel database errors, I can convert the diesel error into my custom error type, then throw it back up the stack using `anyhow`. This works _really_ well in conjunction with Rocket's Responder impl.
EDIT: This is pretty close to what TFA is saying as well, I should have read more in the article, heh