diff --git a/src/Curl/Curl.php b/src/Curl/Curl.php index 94f3469..38a11ee 100644 --- a/src/Curl/Curl.php +++ b/src/Curl/Curl.php @@ -346,6 +346,12 @@ class Curl $this->curlErrorMessage = curl_error($ch); } $this->curlError = !($this->curlErrorCode === 0); + + // Include additional error code information in error message when possible. + if ($this->curlError && function_exists('curl_strerror')) { + $this->curlErrorMessage = curl_strerror($this->curlErrorCode) . ': ' . $this->curlErrorMessage; + } + $this->httpStatusCode = $this->getInfo(CURLINFO_HTTP_CODE); $this->httpError = in_array(floor($this->httpStatusCode / 100), array(4, 5)); $this->error = $this->curlError || $this->httpError;