throwIfFinished method

  1. @protected
void throwIfFinished(
  1. String action
)

Throws StateError if the job has finished: a context that outlived its job neither writes nor starts anything.

Also throws while the core unwinds the cleanup stack — see throwIfDisposing.

Implementation

@protected
void throwIfFinished(String action) {
  if (_owner.isFinished) {
    throw StateError('$_owner has already finished, cannot $action');
  }
  throwIfDisposing(action);
}