类 NestedExceptionUtils

    • 方法详细资料

      • getRootCause

        @Nullable
        public static Throwable getRootCause​(@Nullable
                                             Throwable original)
        Retrieve the innermost cause of the given exception, if any.
        参数:
        original - the original exception to introspect
        返回:
        the innermost exception, or null if none
        从以下版本开始:
        4.3.9
      • getMostSpecificCause

        public static Throwable getMostSpecificCause​(Throwable original)
        Retrieve the most specific cause of the given exception, that is, either the innermost cause (root cause) or the exception itself.

        Differs from getRootCause(java.lang.Throwable) in that it falls back to the original exception if there is no root cause.

        参数:
        original - the original exception to introspect
        返回:
        the most specific cause (never null)
        从以下版本开始:
        4.3.9