addError method

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

Adds an error to the sink.

Must not be called on a closed sink.

Implementation

@override
void addError(Object error, [StackTrace stackTrace]) {
  if (_done?.isCompleted == false) {
    _done.completeError(error, stackTrace);
  } else if (_done == null) {
    Zone.current.handleUncaughtError(error, stackTrace);
  }
}