<?php

declare(strict_types=1);

namespace App\Framework\DateTime\Exceptions;

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

class InvalidTimezoneException extends FrameworkException
{
    public function __construct(string $timezone, ?\Throwable $previous = null)
    {
        $message = sprintf('Ungültige Zeitzone: "%s"', $timezone);

        $context = ExceptionContext::forOperation('timezone.validate', 'datetime')
            ->withData(['timezone' => $timezone]);

        parent::__construct($message, $context, 0, $previous);
    }
}
