reportError method

Future<void> reportError(
  1. dynamic ex,
  2. StackTrace stack, {
  3. String? message,
  4. String? library,
  5. InformationCollector? informationCollector,
})

Report the error in an isolate or in a run zone.

Implementation

Future<void> reportError(
  dynamic ex,
  StackTrace stack, {
  String? message,
  String? library,
  InformationCollector? informationCollector,
}) async {
  if (_errorReport == null) {
    message ??= 'while attempting to run your app';
    library ??= 'Your app';
    _debugReportException(
      ErrorSummary(message),
      ex,
      stack,
      library: library,
      informationCollector: informationCollector,
    );
  } else {
    await _errorReport!(ex, stack);
  }
}