Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit b74598b

Browse files
committed
Better error logging when lucene fails to open or create an index.
1 parent 533022c commit b74598b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

core/src/plugins/index.lucene/class.AjxpLuceneIndexer.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -771,13 +771,23 @@ protected function loadIndex($repositoryId, $create = true, $resolveUserId = nul
771771
$iPath = $this->getIndexPath($repositoryId, $resolveUserId);
772772
}
773773
if (is_dir($iPath)) {
774-
$index = Zend_Search_Lucene::open($iPath);
774+
try{
775+
$index = Zend_Search_Lucene::open($iPath);
776+
}catch (Zend_Search_Lucene_Exception $se){
777+
$this->logError(__FUNCTION__, "Error while trying to load lucene index at path ".$iPath."! Maybe a permission issue?");
778+
throw $se;
779+
}
775780
} else {
776781
if (!$create) {
777782
$messages = ConfService::getMessages();
778783
throw new Exception($messages["index.lucene.9"]);
779784
}
780-
$index = Zend_Search_Lucene::create($iPath);
785+
try{
786+
$index = Zend_Search_Lucene::create($iPath);
787+
}catch (Zend_Search_Lucene_Exception $se){
788+
$this->logError(__FUNCTION__, "Error while trying to create lucene index at path ".$iPath."! Maybe a permission issue?");
789+
throw $se;
790+
}
781791
}
782792
return $index;
783793
}

0 commit comments

Comments
 (0)