Просмотр исходного кода

Added exception raised when there is a curl error.

Raphael Antonmattei 10 лет назад
Родитель
Сommit
56dcd1a668
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      src/Monolog/Handler/LogglyHandler.php

+ 4 - 1
src/Monolog/Handler/LogglyHandler.php

@@ -87,7 +87,10 @@ class LogglyHandler extends AbstractProcessingHandler
         curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 
-        curl_exec($ch);
+        if (curl_exec($ch) === false) {
+            throw new \RuntimeException(sprintf('Curl error (code %s): %s', curl_errno($ch), curl_error($ch)));
+        }
+
         curl_close($ch);
     }