Revision: 14739
          http://gate.svn.sourceforge.net/gate/?rev=14739&view=rev
Author:   valyt
Date:     2011-12-12 14:28:06 +0000 (Mon, 12 Dec 2011)
Log Message:
-----------
Error logging on the remote side when using RemoteQueryRunners.

Modified Paths:
--------------
    
mimir/trunk/mimir-web/grails-app/controllers/gate/mimir/web/SearchController.groovy

Modified: 
mimir/trunk/mimir-web/grails-app/controllers/gate/mimir/web/SearchController.groovy
===================================================================
--- 
mimir/trunk/mimir-web/grails-app/controllers/gate/mimir/web/SearchController.groovy
 2011-12-12 14:26:59 UTC (rev 14738)
+++ 
mimir/trunk/mimir-web/grails-app/controllers/gate/mimir/web/SearchController.groovy
 2011-12-12 14:28:06 UTC (rev 14739)
@@ -577,6 +577,7 @@
           stream.writeInt(docCount)
         }
       } catch(Exception e) {
+        log.warn("Error while sending document current count", e)
         response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
             "Error while obtaining the documents count: \"" + e.getMessage() + 
"\"!")
       }
@@ -605,6 +606,7 @@
           stream.writeInt(docCount)
         }
       } catch(Exception e) {
+        log.warn("Error while sending document count", e)
         response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
             "Error while obtaining the documents count: \"" + e.getMessage() + 
"\"!")
       }
@@ -634,6 +636,7 @@
             stream.writeObject(Integer.toString(docId))
           }
         } catch(Exception e){
+          log.warn("Error while sending document ID", e)
           response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
               "Error while obtaining the document ID: \"" +
               e.getMessage() + "\"!")
@@ -668,6 +671,7 @@
             stream.writeObject(hits)
           }
         }catch(Exception e){
+          log.warn("Error while sending document hits", e)
           response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
           "Error while obtaining the hits: \"" + e.getMessage() + "\"!")
         }
@@ -695,12 +699,13 @@
        int docCount = runner.getDocumentsCount()
         double[] scores = new double[docCount]
         for(int i = 0; i < docCount; i++) {
-          docCount[i] = runner.getDocumentScore(i)
+          scores[i] = runner.getDocumentScore(i)
         }
         new ObjectOutputStream (response.outputStream).withStream {stream ->
          stream.writeObject(scores)
         }
       }catch(Exception e){
+        log.warn("Error while sending document scores", e)
         response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
         "Error while obtaining the scores: \"" + e.getMessage() + "\"!")
       }
@@ -735,16 +740,22 @@
           String documentRankParam = p["documentRank"]
           if (documentRankParam) {
             int documentRank = documentRankParam.toInteger()
-            int docId = runner.getDocumentID(documentRank)
+            documentId = runner.getDocumentID(documentRank)
           } else {
+            log.warn("Error while sending document data: " +
+              "Neither documentId nor documentRank parameters were provided!")
             response.sendError(HttpServletResponse.SC_BAD_REQUEST,
               "Neither documentId nor documentRank parameters were provided!")
           }
         } else {
+          log.warn("Error while sending document data: " +
+              "Query ID ${queryId} not known!")
           response.sendError(HttpServletResponse.SC_NOT_FOUND,
             "Query ID ${queryId} not known!")
         }
       } else {
+        log.warn("Error while sending document data: " +
+            "Neither documentId nor queryId parameters were provided!")
         response.sendError(HttpServletResponse.SC_BAD_REQUEST,
             "Neither documentId nor queryId parameters were provided!")
       }
@@ -756,13 +767,16 @@
           stream.writeObject(index.getDocumentData(documentId))
         }
       } catch(Exception e) {
+        log.warn("Error while sending document data", e)
         response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
             "Error while obtaining the document ID: \"" +
             e.getMessage() + "\"!")
       }
     } else {
+      log.warn("Error while sending document data: " +
+          "Could not find a valid documentId with the provided parameters!")
       response.sendError(HttpServletResponse.SC_BAD_REQUEST,
-        "Could not find a valid documentId with the provided parameters!")
+          "Could not find a valid documentId with the provided parameters!")
     }
   }
   

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


------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to