MUST NOT catch Throwable when catching Exceptions.
Never catch Throwable because we could be talking about extremely fatal exceptions that should never be caught and that should crash the process. For example if the JVM throws an out of memory error, even if you re-throw that exception in that catch clause, it may be too late - given that the process is out of memory, the garbage collector probably took over and froze everything, with the process ending in a zombie unrecoverable state. Which means that an external supervisor (like Upstart) will not get an opportunity to restart it.
Read more.
Войдите чтобы поставить Нравится
Войдите чтобы прокомментировать