# PodNotOfRequiredTypeException constructor

PodNotOfRequiredTypeException({

1. required String name,
2. required Class requiredType,
3. required Class actualType,

})

Exception thrown when a pod retrieved from the context is not of the expected type.

This typically occurs when there's a type mismatch between what was requested and what was actually registered in the pod factory. It can happen due to incorrect pod definitions, generic type erasure, or configuration errors.

### Example:

    // Requesting a specific type
    try {
      final service = podFactory.getPod<UserService>('userService');
    } catch (e) {
      if (e is PodNotOfRequiredTypeException) {
        print('Expected: ${e.requiredType}');
        print('Actual: ${e.actualType}');
        print('Pod name: ${e.name}');
      }
    }

### Common causes:

    // Wrong pod registration
    @Pod('userService')
    AdminService createUserService() => AdminService(); // Returns wrong type

    // Generic type issues
    @Pod()
    List<String> createList() => <int>[1, 2, 3]; // Type mismatch

## Implementation

    PodNotOfRequiredTypeException({required this.name, required this.requiredType, required this.actualType}) : super(
      '''
    Pod named '$name' was expected to be of type '${requiredType.getQualifiedName()}'
    but was actually registered as '${actualType.getQualifiedName()}'. Verify the registration or request the expected type.
    '''
    );