Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

curl_error must be called before curl_close #150

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MAIKS1900
Copy link

@MAIKS1900 MAIKS1900 changed the title curl_close must be called before curl_close curl_error must be called before curl_close Aug 7, 2024
@EfrosIonelu
Copy link

EfrosIonelu commented Nov 8, 2024

...
        $curl_error = curl_error($curl);
        $info = curl_getinfo($curl);
        $this->curlInfo = $info;
        $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
        curl_close($curl);

        if (!$response) {
            // Debugging output
            $debugMessage = "cURL error: " . $curl_error . PHP_EOL .
                "HTTP code: " . $httpCode . PHP_EOL .
                "Request URL: " . $url . PHP_EOL .
                "cURL info: " . print_r($info, true);

            throw new Exception($debugMessage);
        } 

--- @MAIKS1900

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants