causalChain

Gets a Throwable cause chain as a list. The first entry in the list will be this followed by its cause hierarchy. Note that this is a snapshot of the cause chain and will not reflect any subsequent changes to the cause chain.

Here's an example of how it can be used to find specific types of exceptions in the cause chain:

e.causalChain.filterIsInstance<IOException>()

Receiver

the non-null Throwable to extract causes from

Return

an unmodifiable list containing the cause chain starting with this

See also

Throws

if there is a loop in the causal chain