mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
Accept SocketException as an indication of no running server
This commit is contained in:
parent
650bcec9b7
commit
ef9e96721f
@ -25,6 +25,7 @@ import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.ConnectException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.SocketException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.apache.solr.client.solrj.SolrQuery;
|
||||
@ -146,7 +147,13 @@ class Server {
|
||||
|
||||
CoreAdminRequest.getStatus(null, solr);
|
||||
} catch (SolrServerException ex) {
|
||||
if (ex.getRootCause() instanceof ConnectException) {
|
||||
|
||||
Throwable cause = ex.getRootCause();
|
||||
|
||||
// TODO: check if SocketExceptions should actually happen (is
|
||||
// probably caused by starting a connection as the server finishes
|
||||
// shutting down)
|
||||
if (cause instanceof ConnectException || cause instanceof SocketException) {
|
||||
return false;
|
||||
} else {
|
||||
throw new RuntimeException("Error checking if server is running", ex);
|
||||
|
Loading…
x
Reference in New Issue
Block a user