Changeset 10194


Ignore:
Timestamp:
2005-06-30T09:24:40+12:00 (19 years ago)
Author:
kjdon
Message:

when doing a search, if teh result is not in the right format, now print the whole result in the error message, not just the first line

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/service/IViaSearch.java

    r10193 r10194  
    127127    }
    128128       
    129     if (results_num.startsWith("Resources: ")) {
     129    if (results_num.startsWith("Resources: ") && doc_ids.startsWith("Ids: ")) {
    130130        results_num = results_num.substring(11);
     131        doc_ids = doc_ids.substring(5).trim();
     132
    131133    } else {
    132         System.err.println("IViaSearch.TextQuery Error: badly formatted results line: "+results_num);
    133         GSXML.addError(this.doc, result, "Error: badly formatted result from IVia server: "+results_num);
    134         return result;
    135     }
    136     if (doc_ids.startsWith("Ids: ")) {
    137         doc_ids = doc_ids.substring(5).trim();
    138     } else {
    139         System.err.println("IViaSearch.TextQuery Error: badly formatted docs line: "+doc_ids);
    140         GSXML.addError(this.doc, result, "Error: badly formatted result from IVia server: "+doc_ids);
     134        System.err.println("IViaSearch.TextQuery Error: badly formatted results:");
     135        StringBuffer result_string = new StringBuffer();
     136        result_string.append("Error: badly formatted result from IVia server:\n ");
     137        result_string.append(results_num);
     138        result_string.append(doc_ids);
     139        String line;
     140        try {
     141        while((line = reader.readLine()) != null) {
     142            result_string.append(line);
     143        }
     144        } catch (Exception e) {
     145        result_string.append("Exception: "+e);
     146        }
     147        GSXML.addError(this.doc, result, result_string.toString());
     148       
    141149        return result;
    142150    }
Note: See TracChangeset for help on using the changeset viewer.