onError method
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,
) {}