Package org.docx4j.org.apache.poi.util
Class ExceptionUtil
java.lang.Object
org.docx4j.org.apache.poi.util.ExceptionUtil
Utility methods for dealing with exceptions/throwables
- Since:
- 5.2.4
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanIt is important never to catch allThrowables.static voidDesigned to be used in conjunction withisFatal(Throwable).
-
Method Details
-
isFatal
It is important never to catch allThrowables. Some likeInterruptedExceptionshould be rethrown. Based on scala.util.control.NonFatal.- Parameters:
throwable- to check- Returns:
- whether the
Throwableis a fatal error
-
rethrow
Designed to be used in conjunction withisFatal(Throwable). This method should be used with care.The input throwable is thrown if it is an
Erroror aRuntimeException. Otherwise, the method wraps the throwable in a RuntimeException and rethrows that.- Parameters:
throwable- to check- Throws:
Error- the input throwable if it is anError.RuntimeException- the input throwable if it is anRuntimeExceptionOtherwise wraps the throwable in a RuntimeException.
-