reportError static method
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;
}
}