Revision: 16587
          http://sourceforge.net/p/gate/code/16587
Author:   valyt
Date:     2013-03-13 08:55:20 +0000 (Wed, 13 Mar 2013)
Log Message:
-----------
Catch errors while opening an index and switch state to 'failed' if any occur.

Modified Paths:
--------------
    
mimir/trunk/mimir-web/grails-app/services/gate/mimir/web/LocalIndexService.groovy

Modified: 
mimir/trunk/mimir-web/grails-app/services/gate/mimir/web/LocalIndexService.groovy
===================================================================
--- 
mimir/trunk/mimir-web/grails-app/services/gate/mimir/web/LocalIndexService.groovy
   2013-03-13 02:19:03 UTC (rev 16586)
+++ 
mimir/trunk/mimir-web/grails-app/services/gate/mimir/web/LocalIndexService.groovy
   2013-03-13 08:55:20 UTC (rev 16587)
@@ -176,10 +176,16 @@
         throw new IllegalStateException(
         "Index ${index.indexId} is not open for searching")
       }
-      engine = new QueryEngine(new File(index.indexDirectory))
-      engine.queryTokeniser = queryTokeniser
-      engine.executor = searchThreadPool
-      queryEngines[index.id] = engine
+      try {
+        engine = new QueryEngine(new File(index.indexDirectory))
+        engine.queryTokeniser = queryTokeniser
+        engine.executor = searchThreadPool
+        queryEngines[index.id] = engine
+      } catch (Exception e) {
+        log.error("Cannot open local index at ${index?.indexDirectory}", e)
+        index.state = Index.FAILED
+        return null
+      }
     }
     // the scorer may have changed, so we update it every time
     if(index.scorer) {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to