diff options
Diffstat (limited to 'app/Core')
-rw-r--r-- | app/Core/Http/Client.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/Core/Http/Client.php b/app/Core/Http/Client.php index 230a5958..d875fe67 100644 --- a/app/Core/Http/Client.php +++ b/app/Core/Http/Client.php @@ -265,14 +265,16 @@ class Client extends Base $body = curl_exec($curlSession); - if (! $body) { - $this->logger->error('HttpClient: request failed ('.$url.')'); + if ($body === false) { + $errorMsg = curl_error($curlSession); + curl_close($curlSession); + + $this->logger->error('HttpClient: request failed ('.$url.' - '.$errorMsg.')'); if ($raiseForErrors) { - throw new ClientException('Unreachable URL: '.$url); + throw new ClientException('Unreachable URL: '.$url.' ('.$errorMsg.')'); } - curl_close($curlSession); return ''; } |