exceptions
LogoModularity

exceptions#

Exception types for the Modularity framework.

All exceptions extend ModularityException, which implements Exception for backward compatibility with existing catch clauses.

try {
  await controller.initialize(registry);
} on CircularDependencyException catch (e) {
  print('Cycle: ${e.dependencyChain}');
} on DependencyNotFoundException catch (e) {
  print('Missing: ${e.requestedType}, available: ${e.availableTypes}');
} on ModularityException catch (e) {
  print('Framework error: ${e.message}');
}

Exceptions#

ExceptionDescription
CircularDependencyException Thrown when a circular dependency is detected in the module import graph.
DependencyNotFoundException Thrown when a requested dependency cannot be found in the binder chain.
ModularityException Base exception for all Modularity framework errors.
ModuleConfigurationException Thrown when a module is incorrectly configured.
ModuleLifecycleException Thrown when a module lifecycle operation fails.