Skip to content

Commit

Permalink
Catch runtime error when setting for Solr core is missing
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed Jan 18, 2025
1 parent 0070204 commit b25e4f2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Classes/Controller/OaiPmhController.php
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,12 @@ protected function fetchDocumentSet(): array

$solrQuery .= ' AND timestamp:[' . $from . ' TO ' . $until . ']';

$solr = Solr::getInstance($this->settings['solrcore']);
$solrcore = $this->settings['solrcore'] ?? false;
if (!$solrcore) {
$this->logger->error('Solr core not configured');
return $documentSet;
}
$solr = Solr::getInstance($solrcore);
if (!$solr->ready) {
$this->logger->error('Apache Solr not available');
return $documentSet;
Expand Down

0 comments on commit b25e4f2

Please sign in to comment.