reportError static method

void reportError(
  1. D4rtException error, [
  2. StackTrace? stackTrace
])

Reports an error to the reporter (only if tracking is enabled).

This is called automatically by the D4rtException constructor. The stack trace is stored on the exception instance itself (not in a side map), so no parallel Map.remove is needed on revoke.

Implementation

static void reportError(D4rtException error, [StackTrace? stackTrace]) {
  if (_trackingEnabled) {
    _errors.add(error);
    error.trackedStackTrace = stackTrace ?? StackTrace.current;
  }
}