Skip to content

Commit ae6a3e5

Browse files
committed
Append existing error message when not empty
1 parent 156b99a commit ae6a3e5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Curl/Curl.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,10 @@ public function exec($ch = null)
350350

351351
// Include additional error code information in error message when possible.
352352
if ($this->curlError && function_exists('curl_strerror')) {
353-
$this->curlErrorMessage = curl_strerror($this->curlErrorCode) . ': ' . $this->curlErrorMessage;
353+
$this->curlErrorMessage =
354+
curl_strerror($this->curlErrorCode) . (
355+
empty($this->curlErrorMessage) ? '' : ': ' . $this->curlErrorMessage
356+
);
354357
}
355358

356359
$this->httpStatusCode = $this->getInfo(CURLINFO_HTTP_CODE);

0 commit comments

Comments
 (0)