<?php

declare(strict_types=1);

namespace App\Framework\HttpClient\Exception;

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

class CurlExecutionFailed extends FrameworkException
{
    public function __construct(string $message, int $code)
    {
        $context = ExceptionContext::forOperation('http.curl', 'CurlHttpClient')
            ->withData(['curl_error' => $message, 'curl_code' => $code]);

        parent::__construct(
            "Curl konnte nicht ausgeführt werden. ($message) [$code]",
            $context,
            $code
        );
    }
}
