public static function encountered(
        Throwable $exception,
        object $target
    ): CannotHydrate {
        return new HydrationFailed(withMessage(
            'Could not hydrate the `%s`: %s',
            theClassOfThe($target),
            $exception->getMessage()
        ), 0, $exception);
    }
public static function encountered(
        Throwable $exception,
        object $target
    ): CannotHydrate {
        return new HydrationFailed(withMessage(
            'Could not hydrate the `%s`: %s',
            theClassOfThe($target),
            $exception->getMessage()
        ), 0, $exception);
    }
public static function encountered ( Throwable $ exception , object $ target ) : CannotHydrate { return new HydrationFailed ( withMessage ( 'Could not hydrate the `%s`: %s' , theClassOfThe ( $ target ) , $ exception -> getMessage ( ) ) , 0 , $ exception ) ; }
Notifies the client code that an exception was encountered during the
hydration process.

@param Throwable $exception The exception that was thrown.
@param object    $target    The object that was being hydrated.
@return CannotHydrate       The exception to throw.
Notifies the client code that an exception was encountered during the hydration process .