Skip to content

Commit 50fcde4

Browse files
committed
made manager throw exception on bad configuration without refreshing
1 parent a5e4468 commit 50fcde4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Service/Manager.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,12 @@ public function commit(array $params = [])
372372
$bulkResponse = $this->client->bulk($bulkQueries);
373373
$this->stopwatch('stop', 'bulk');
374374

375+
if ($bulkResponse['errors']) {
376+
throw new ClientErrorResponseException(
377+
'An error occurred during the commit to elasticsearch'
378+
);
379+
}
380+
375381
$this->bulkQueries = [];
376382
$this->bulkCount = 0;
377383

@@ -386,12 +392,6 @@ public function commit(array $params = [])
386392
break;
387393
}
388394

389-
if ($bulkResponse['errors']) {
390-
throw new ClientErrorResponseException(
391-
'An error occurred during the commit to elasticsearch'
392-
);
393-
}
394-
395395
$this->eventDispatcher->dispatch(
396396
Events::POST_COMMIT,
397397
new CommitEvent($this->getCommitMode(), $bulkResponse)

0 commit comments

Comments
 (0)