<?php

declare(strict_types=1);

namespace App\Framework\Redis;

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

/**
 * Exception thrown when Redis connection fails
 */
final class RedisConnectionException extends FrameworkException
{
    public function __construct(string $message, int $code = 0, ?\Throwable $previous = null, ?int $retryAfter = null)
    {
        $context = ExceptionContext::forOperation('Redis Connection');
        $errorCode = CacheErrorCode::CONNECTION_FAILED;

        parent::__construct($message, $context, $code, $previous, $errorCode, $retryAfter);
    }
}
