<?php

declare(strict_types=1);

namespace App\Framework\DI\Exceptions;

use App\Framework\Exception\ExceptionContext;
use App\Framework\Exception\FrameworkException;

final class LazyLoadingException extends FrameworkException
{
    public function __construct(
        string $class,
        int $code = 0,
        ?\Throwable $previous = null
    ) {
        parent::__construct(
            message: "Lazy Loading wird für die Klasse $class nicht unterstützt",
            context: ExceptionContext::forOperation('lazy_loading', 'DI')->withData(['class' => $class]),
            code: $code,
            previous: $previous
        );
    }
}
