CausedByException<E extends Exception> extension

Allow exception chaining. example:

try {
  ...
} on Exception (e, stackTrace) {
  throw
}
on
  • E

Methods

causedBy(Object chainedException, StackTrace stackTrace) → E

Available on E, provided by the CausedByException extension

Marks this exception as being caused by chainedException.
getCausedByException() → ErrorStack?

Available on E, provided by the CausedByException extension

Retrieves the caused exception for this exception.
toStringWithCause() String

Available on E, provided by the CausedByException extension

calls toString appended by the caused exception, if any.