1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-05 04:37:38 +02:00

Added exception raised when there is a curl error.

This commit is contained in:
Raphael Antonmattei
2015-03-31 17:37:03 -04:00
parent df7da8a555
commit 56dcd1a668

View File

@@ -87,7 +87,10 @@ class LogglyHandler extends AbstractProcessingHandler
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 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); curl_close($ch);
} }