addError method

void addError(
  1. Object error, [
  2. StackTrace? stackTrace
])

Implementation

void addError(Object error, [StackTrace? stackTrace]) {
  _streamController.addError(error, stackTrace);
  if (_finalTask != null) {
    _finalTask!.state = TaskState.error;
    _streamController.add(_finalTask!);
  } else {
    _streamController
        .add(ProcessTask(processed: 0, total: 0, state: TaskState.error));
  }
}