# PodNotOfRequiredTypeException class

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

Inheritance
  - Object
  - Error
  - RuntimeException
  - PodNotOfRequiredTypeException
Available extensions
  - ErrorExtensions
  - ExceptionExtensions
  - RuntimeExceptionExtensions
  - ThrowableExtensions

## Constructors

PodNotOfRequiredTypeException.new({required String name, required Class requiredType, required Class actualType})
  Exception thrown when a pod retrieved from the context is not of the expected type.

## Properties

actualType → Class
  The actual type of the pod found in the context.
  final
cause → Object?
  The underlying cause of this exception, if any.
  final inherited
hashCode → int
  The hash code for this object.
  no setter inherited
message → String
  The message describing the error.
  final inherited
name → String
  The name of the pod that has the wrong type.
  final
requiredType → Class
  The expected type of the pod.
  final
runtimeType → Type
  A representation of the runtime type of the object.
  no setter inherited
stackTrace → StackTrace
  The associated stack trace.
  final inherited

## Methods

getCause() → Object
  The cause of this exception, if any.
  inherited
getMessage() → String
  The message associated with this exception.
  inherited
getStackTrace() → StackTrace
  The stack trace associated with this exception.
  inherited
noSuchMethod(Invocation invocation) → dynamic
  Invoked when a nonexistent method or property is accessed.
  inherited
printStackTrace([bool useErrorPrint = false]) → void

  Available on Error, provided by the ErrorExtensions extension

  Prints the error along with its stack trace.
printStackTrace([StackTrace? stacktrace, bool useErrorPrint = false]) → void

  Available on Exception, provided by the ExceptionExtensions extension

  Prints the exception and optional StackTrace if available.
printStackTrace([bool useErrorPrint = false]) → void

  Available on RuntimeException, provided by the RuntimeExceptionExtensions extension

  Extension on RuntimeException to support pretty stack trace printing.
printStackTrace([bool useErrorPrint = false]) → void

  Available on Throwable, provided by the ThrowableExtensions extension

  Extension on Throwable to support printing stack traces in a unified way.
toString() → String
  A string representation of this object.
  inherited

## Operators

operator ==(Object other) → bool
  The equality operator.
  inherited