Skip to content
Snippets Groups Projects
Commit 8f376336 authored by Demian Katz's avatar Demian Katz Committed by Robert Lange
Browse files

Respect $tolerateBackendExceptions during fallback loading.

parent 6ceb3c7f
Branches
Tags
No related merge requests found
...@@ -207,8 +207,19 @@ class Loader implements \Zend\Log\LoggerAwareInterface ...@@ -207,8 +207,19 @@ class Loader implements \Zend\Log\LoggerAwareInterface
if ($list->hasUnchecked() && $this->fallbackLoader if ($list->hasUnchecked() && $this->fallbackLoader
&& $this->fallbackLoader->has($source) && $this->fallbackLoader->has($source)
) { ) {
$fallbackRecords = $this->fallbackLoader->get($source) try {
->load($list->getUnchecked()); $fallbackRecords = $this->fallbackLoader->get($source)
->load($list->getUnchecked());
} catch (\VuFindSearch\Backend\Exception\BackendException $e) {
if (!$tolerateBackendExceptions) {
throw $e;
}
$fallbackRecords = [];
$this->logWarning(
'Exception when trying to retrieve fallback records from '
. $source . ': ' . $e->getMessage()
);
}
foreach ($fallbackRecords as $record) { foreach ($fallbackRecords as $record) {
$retVal[] = $record; $retVal[] = $record;
if (!$list->check($record->getUniqueId())) { if (!$list->check($record->getUniqueId())) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment