onError method

void onError(
  1. ScopeObservable target,
  2. ScopePhase phase,
  3. Object error,
  4. StackTrace? stackTrace,
)

Something failed; phase says what was running.

Not always preceded by onInit. The synchronous init() hook runs before either kind of family has announced anything, so a hook that threw reports ScopePhase.initialization on its own — and for a structural family (no phase of its own) that one event is the scope's whole recording, since the teardown pair belongs to a scope that announced onInit.

Implementation

void onError(
  ScopeObservable target,
  ScopePhase phase,
  Object error,
  StackTrace? stackTrace,
) {}