<?php
declare(strict_types=1);

namespace App\Framework\DI\Exceptions;

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

class ContainerException extends FrameworkException
{
    /**
     * Simplified constructor for simple error messages
     * Automatically creates an ExceptionContext for DI operations
     */
    public function __construct(
        string $message = '',
        ?ExceptionContext $context = null,
        int $code = 0,
        ?\Throwable $previous = null
    ) {
        parent::__construct(
            message: $message,
            context: $context ?? ExceptionContext::forOperation('dependency_injection', 'DI Container'),
            code: $code,
            previous: $previous
        );
    }
}
