throwIfCancelled method

  1. @protected
void throwIfCancelled()

Throws the cancellation the job has accepted, or the one it ended with: a job an engine finished by hand has no pendingCancel, and its cancellation lives in the outcome alone.

Implementation

@protected
void throwIfCancelled() {
  final cancelled = _owner._pendingCancel;
  if (cancelled != null) {
    throw cancelled;
  }
  final outcome = _owner._outcome;
  if (outcome is Cancelled) {
    throw outcome;
  }
}