CausedByException<E extends Exception> extension

Allow exception chaining. example:

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

Methods

causedBy(Object chainedException, StackTrace stackTrace) → E
Marks this exception as being caused by chainedException.
getCausedByException() → ErrorStack?
Retrieves the caused exception for this exception.
toStringWithCause() String
calls toString appended by the caused exception, if any.