You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unless I missed something, Errors currently is used to wrap all throwables. It would be useful to be able to use Errors (or a generalized version of it, say, SpecificErrors) to wrap interfaces which throw only one checked exception, for example, IOException. Thus, SpecificErrors would be a generic type, with a type parameter <E> which designates the kind of throwable to be wrapped. Any other unchecked exception thrown by the wrappers created by SpecificErrors would be left alone and thrown as-is.
The text was updated successfully, but these errors were encountered:
It's been a long time, but I have a hazy memory that template type inference didn't work like I expected when I tried it. Would be happy to look at a PR which explores this. I'm very busy atm, can't promise a fast turnaround time.
Related to this issue and #8, I’d like to mention that I just released a few classes, inspired by durian’s “error” classes, which implement what I was thinking about (more strictly typed, with no duplication of Guava, and IMHO slightly simpler to use and understand).
Congratulations! Looks like this issue is resolved, but I'll keep it open indefinitely to advertise your project. For now I still don't understand the need for SpecificErrors, but the great thing about open source is that you don't need convince me :D
Unless I missed something,
Errors
currently is used to wrap all throwables. It would be useful to be able to useErrors
(or a generalized version of it, say,SpecificErrors
) to wrap interfaces which throw only one checked exception, for example,IOException
. Thus,SpecificErrors
would be a generic type, with a type parameter<E>
which designates the kind of throwable to be wrapped. Any other unchecked exception thrown by the wrappers created bySpecificErrors
would be left alone and thrown as-is.The text was updated successfully, but these errors were encountered: