Changeset 22691

Show
Ignore:
Timestamp:
19.08.2010 19:09:20 (9 years ago)
Author:
ak19
Message:

Cleaner exit when the client tries to a remote greenstone server that is not running (first noticed when the greenstone version is requested).

Location:
main/trunk/gli/src/org/greenstone/gatherer
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/Gatherer.java

    r22661 r22691  
    334334        // Display the version to make error reports a lot more useful 
    335335        System.err.println("Remote Greenstone server version: " + greenstoneVersion); 
     336        if(greenstoneVersion == -1) { // remote server not running 
     337            Gatherer.exit(); 
     338        } 
    336339        if(greenstoneVersion >= 3) { 
    337340            this.GS3 = true; 
  • main/trunk/gli/src/org/greenstone/gatherer/remote/RemoteGreenstoneServer.java

    r19229 r22691  
    195195        result = result.substring(index+1).trim(); // skip the space after colon, must remove surrounding spaces 
    196196    } 
    197     int greenstoneVersion = Integer.parseInt(result); 
     197    // if space is returned, then the request failed (the server may not have been running) 
     198    int greenstoneVersion = result.equals("") ? -1 : Integer.parseInt(result); 
    198199    return greenstoneVersion; 
    199200    }