Note that they catch Throwable and rethrow it directly from the Closer instance.

As to why it is Throwable and not, let's say IOException or RuntimeException, it's because the Closermust know that an error occurred so that it can close the resources properly. All is only a matter of doing things proper. So it can work if you don't do it properly, but it's not guaranteed.

Not that if your method can throw MyOwnCheckedException, for instance, you have to declare them: