setError method

void setError (dynamic error, [ StackTrace stackTrace ])

Completes this to a closed sink whose Sink.done future emits error.

This is useful when the process of loading the sink fails.

Either of setDestinationSink or setError may be called at most once. Trying to call either of them again will fail.

Implementation

void setError(error, [StackTrace stackTrace]) {
  setDestinationSink(new NullStreamSink.error(error, stackTrace));
}