spring-framework / org.springframework.core / NestedExceptionUtils / getMostSpecificCause

getMostSpecificCause

open static fun getMostSpecificCause(original: Throwable): Throwable

Retrieve the most specific cause of the given exception, that is, either the innermost cause (root cause) or the exception itself.

Differs from #getRootCause in that it falls back to the original exception if there is no root cause.

Parameters

original - the original exception to introspect

Return
the most specific cause (never null)

Since
4.3.9