throw execption if creation/opening of index fails

This commit is contained in:
Uwe Steinmann 2020-09-12 12:49:33 +02:00
parent 41c08492ac
commit 25fc979a3a

View File

@ -31,16 +31,20 @@ class SeedDMS_Lucene_Indexer {
static function open($conf) { /* {{{ */ static function open($conf) { /* {{{ */
try { try {
$index = Zend_Search_Lucene::open($conf['indexdir']); $index = Zend_Search_Lucene::open($conf['indexdir']);
return($index); return($index);
} catch (Exception $e) { } catch (Exception $e) {
return null; return null;
} }
} /* }}} */ } /* }}} */
static function create($conf) { /* {{{ */ static function create($conf) { /* {{{ */
$index = Zend_Search_Lucene::create($conf['indexdir']); try {
return($index); $index = Zend_Search_Lucene::create($conf['indexdir']);
return($index);
} catch (Exception $e) {
return null;
}
} /* }}} */ } /* }}} */
/** /**