onLifecycleError property

void Function(Object error, StackTrace stackTrace)? onLifecycleError
getter/setter pair

Configurable handler for non-fatal lifecycle errors.

Called when a subsystem's Subsystem.dispose throws during teardown, or when batch cleanup encounters secondary errors. If null, lifecycle errors are silently ignored.

SubsystemInstanceRegistry.onLifecycleError = (error, stackTrace) {
  log('Lifecycle error: $error', stackTrace: stackTrace);
};

Implementation

static void Function(Object error, StackTrace stackTrace)? onLifecycleError;