Skip to content

Commit

Permalink
feat: don't throw exceptions if logger doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
wilr authored Nov 29, 2022
1 parent 2ce9593 commit dca145d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/ElasticaService.php
Original file line number Diff line number Diff line change
Expand Up @@ -460,16 +460,14 @@ protected function printActionMessage(DataObject $record, $action)

/**
* If a logger is configured, log the exception there.
* Otherwise the exception is thrown
*
* @param Exception $exception
* @throws Exception
* @param Exception $exception\
*/
protected function exception($exception)
{
// If no logger specified expose error normally
if (!$this->logger) {
throw $exception;
return;
}

$message = sprintf(
Expand Down Expand Up @@ -516,7 +514,6 @@ protected function logResponse(Response $response = null)
*
* @param callable $callback A callback that generates an Elastica Response object
* @return Response The response
* @throws Exception
*/
protected function runQuery(callable $callback)
{
Expand Down

0 comments on commit dca145d

Please sign in to comment.