mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-53271 search: Catch Solr Server errors when adding doc
This commit is contained in:
parent
03b8b55f10
commit
63d5007b77
1 changed files with 4 additions and 0 deletions
|
@ -309,6 +309,10 @@ class engine extends \core_search\engine {
|
|||
$result = $this->get_search_client()->addDocument($solrdoc, true, static::AUTOCOMMIT_WITHIN);
|
||||
} catch (\SolrClientException $e) {
|
||||
debugging('Solr client error adding document with id ' . $doc['id'] . ': ' . $e->getMessage(), DEBUG_DEVELOPER);
|
||||
} catch (\SolrServerException $e) {
|
||||
// We only use the first line of the message, as it's a fully java stacktrace behind it.
|
||||
$msg = strtok($e->getMessage(), "\n");
|
||||
debugging('Solr server error adding document with id ' . $doc['id'] . ': ' . $msg, DEBUG_DEVELOPER);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue