Skip to content

Commit 736e512

Browse files
committed
FIX: keep the error and error string when a request produces an error.
1 parent 71bc42a commit 736e512

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

libraries/Curl.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,16 +298,19 @@ public function execute()
298298
// Execute the request & and hide all output
299299
$this->response = curl_exec($this->session);
300300
$this->info = curl_getinfo($this->session);
301-
301+
302302
// Request failed
303303
if ($this->response === FALSE)
304304
{
305-
$this->error_code = curl_errno($this->session);
306-
$this->error_string = curl_error($this->session);
307-
305+
$errno = curl_errno($this->session);
306+
$error = curl_error($this->session);
307+
308308
curl_close($this->session);
309309
$this->set_defaults();
310-
310+
311+
$this->error_code = $errno;
312+
$this->error_string = $error;
313+
311314
return FALSE;
312315
}
313316

0 commit comments

Comments
 (0)