notifyObserver method

  1. @protected
void notifyObserver(
  1. Object error,
  2. StackTrace stackTrace
)

Announces error to the observer and asks nobody to answer for it: the door an engine announces through.

For an error the engine answers for in its own way, or one an outcome of its making will carry: the core does nothing more with it, and asks nobody about it, Job.isCancellationError included. A Failed an engine hands to finish needs no call here: finish announces it itself. notifyError announces the same way, and goes on to the answer.

The observer is told about one error at a time: a ParallelWaitError is walked as Job.visitErrors walks it, and each failure and each cancellation inside it gets a call of its own, with its own stack trace. The job's own cancellation inside one is left out: the outcome says it. A failure comes with JobErrorAnswer.later, even on a job Job.ignoreFailure was called on: the core cannot say what an engine will do with it. A cancellation comes with JobErrorAnswer.cancellation.

The door for an engine: the core does not announce through it, and an override of it hears only what the engine sends. Nor does it note the error as announced: a Failed with the same error handed to finish afterwards is announced again.

Implementation

@protected
void notifyObserver(Object error, StackTrace stackTrace) =>
    _notifyObserver(error, stackTrace, otherwise: JobErrorAnswer.later);