mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-04 20:27:31 +02:00
Fix unhandled throwable
This commit is contained in:
@@ -13,12 +13,12 @@ namespace Monolog\Handler;
|
||||
|
||||
use Elasticsearch\Client;
|
||||
use Elasticsearch\Common\Exceptions\RuntimeException as ElasticSearchRuntimeException;
|
||||
use Exception;
|
||||
use InvalidArgumentException;
|
||||
use Monolog\Formatter\ElasticSearchFormatter;
|
||||
use Monolog\Formatter\FormatterInterface;
|
||||
use Monolog\Logger;
|
||||
use RuntimeException;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Elastic Search handler
|
||||
@@ -149,7 +149,7 @@ class ElasticSearchHandler extends AbstractProcessingHandler
|
||||
if ($responses['errors'] === true) {
|
||||
throw new ElasticSearchRuntimeException('ElasticSearch returned error for one of the records');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
} catch (Throwable $e) {
|
||||
if (! $this->options['ignore_error']) {
|
||||
throw new RuntimeException('Error sending messages to ElasticSearch', 0, $e);
|
||||
}
|
||||
|
@@ -196,7 +196,9 @@ class ElasticSearchHandlerTest extends TestCase
|
||||
0 => 'bar',
|
||||
];
|
||||
|
||||
$hosts = [['host' => '127.0.0.1', 'port' => 9200]];
|
||||
$client = ClientBuilder::create()
|
||||
->setHosts($hosts)
|
||||
->build();
|
||||
$handler = new ElasticSearchHandler($client, $this->options);
|
||||
try {
|
||||
|
Reference in New Issue
Block a user