<?php

declare(strict_types=1);

namespace App\Framework\Core\Exceptions;

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

final class RouteCacheException extends FrameworkException
{
    public function __construct(
        string $cacheFile,
        int $code = 0,
        ?\Throwable $previous = null
    ) {
        parent::__construct(
            message: "Route cache file not found: {$cacheFile}",
            context: ExceptionContext::forOperation('route_cache_load', 'Core')
                ->withData(['cacheFile' => $cacheFile]),
            code: $code,
            previous: $previous
        );
    }
}
