Class ExceptionUtils


  • public final class ExceptionUtils
    extends java.lang.Object
    Util class for exception handling.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Throwable getRootCause​(java.lang.Throwable e)
      Because exceptions might get re-thrown several times, an error message like "java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: ..." might get created.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getRootCause

        public static java.lang.Throwable getRootCause​(java.lang.Throwable e)
        Because exceptions might get re-thrown several times, an error message like "java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: ..." might get created. To avoid this, this method finds the root cause, so that only a message like "java.lang.IllegalArgumentException: ..." is shown.
        Parameters:
        e - A throwable.
        Returns:
        root Throwable