Skip to content
src_exceptions โ€บ Classes โ€บ exceptions

exceptions โ€‹

Exception types for the Modularity framework.

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

dart
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
CircularDependencyExceptionThrown when a circular dependency is detected in the module import graph.
DependencyNotFoundExceptionThrown when a requested dependency cannot be found in the binder chain.
ModularityExceptionBase exception for all Modularity framework errors.
ModuleConfigurationExceptionThrown when a module is incorrectly configured.
ModuleLifecycleExceptionThrown when a module lifecycle operation fails.