<?php

declare(strict_types=1);

namespace App\Framework\Router\Exceptions;

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

final class UnknownResultException extends FrameworkException
{
    public function __construct(
        string $resultClass,
        int $code = 0,
        ?\Throwable $previous = null
    ) {
        parent::__construct(
            message: 'Unbekanntes Ergebnisobjekt: ' . $resultClass,
            context: ExceptionContext::forOperation('result_processing', 'Router')
                ->withData(['resultClass' => $resultClass]),
            code: $code,
            previous: $previous
        );
    }
}
