1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-05 12:47:39 +02:00

Merge pull request #534 from rantonmattei/loggly-handler-curl

Added exception raised when a curl error occurs.
This commit is contained in:
Jordi Boggiano
2015-03-31 22:43:29 +01:00

View File

@@ -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);
}