onError property
getter/setter pair
Error callback that is called when an error is thrown by a listener or assertion.
By default, errors are rethrown preserving their original StackTrace.
Implementation
static ErrorCallback onError = (Object error, StackTrace? stackTrace, ErrorContext context) {
Error.throwWithStackTrace(error, stackTrace ?? StackTrace.current);
};