> Yes, but then you have to handle every possible errors at every call point, and wrap all those you can't handle at the calling site into your own return type... This is well documented.
What? No you don't. You can just propagate up the errors you can't handle with the types they come with.
What language are you using that will automatically infer this at compilation time?(*)
If I understand properly what you are suggesting, to make it work with my goto language (OCaml), I believe that I would have to make every function return a polymorphic variant for the error (aka technicaly equivalent to mandatory try blocks and boxed return types). The only time I had to deal with a library doing that it was not pleasant but it was too long ago for me to remember the details, probably related to complex compilation error messages.
What? No you don't. You can just propagate up the errors you can't handle with the types they come with.