I sill don’t understand is how to write idiomatic code which deals with multiple different error types.
I am not sure if it is idiomatic but I have been following the guidelines int this article for general error handling:
https://nick.groenen.me/posts/rust-error-handling/
And this article for having context: