{"record":{"id":"1b585b36477ce39c","repo":"Seldaek/monolog","slug":"curl-error-code-d-s","errorCode":null,"errorMessage":"Curl error (code %d): %s","messagePattern":"Curl error \\(code (.+?)\\): (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/Monolog/Handler/Curl/Util.php","lineNumber":51,"sourceCode":"\n    /**\n     * Executes a CURL request with optional retries and exception on failure\n     *\n     * @param  CurlHandle  $ch curl handler\n     * @return bool|string @see curl_exec\n     */\n    public static function execute(CurlHandle $ch, int $retries = 5): bool|string\n    {\n        while ($retries > 0) {\n            $retries--;\n            $curlResponse = curl_exec($ch);\n            if ($curlResponse === false) {\n                $curlErrno = curl_errno($ch);\n\n                if (false === \\in_array($curlErrno, self::$retriableErrorCodes, true) || $retries === 0) {\n                    $curlError = curl_error($ch);\n\n                    throw new \\RuntimeException(sprintf('Curl error (code %d): %s', $curlErrno, $curlError));\n                }\n                continue;\n            }\n\n            return $curlResponse;\n        }\n        return false;\n    }\n}\n","sourceCodeStart":33,"sourceCodeEnd":61,"githubUrl":"https://github.com/Seldaek/monolog/blob/57eb1028342134e701e77c617565d51b6e5a2a53/src/Monolog/Handler/Curl/Util.php#L33-L61","documentation":"Error \"Curl error (code %d): %s\" thrown in Seldaek/monolog.","triggerScenarios":"Thrown at src/Monolog/Handler/Curl/Util.php:51 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"57eb1028342134e701e77c617565d51b6e5a2a53","analyzedAt":"2026-08-17T02:36:30.259Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}