Skip to content

Commit

Permalink
Better connecting status update
Browse files Browse the repository at this point in the history
  • Loading branch information
S1artie committed Apr 18, 2018
1 parent f9bba09 commit 728a5ff
Showing 1 changed file with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2276,13 +2276,19 @@ private void connectToTestRunnerAsync(final String aHost, final int aPort) {

@Override
public void run() {
boolean tempSuccess = false;
try {
connectToTestRunner(aHost, aPort);
tempSuccess = true;
return;
} catch (UnknownHostException exc) {
showMessage("Target host name '" + aHost + "' could not be resolved.");
} catch (IOException exc) {
showMessage("Error while connecting to '" + aHost + "': " + exc.getMessage());
} finally {
if (!tempSuccess) {
updateStatus("Not connected");
}
}
}

Expand All @@ -2291,16 +2297,9 @@ public void run() {

private void connectToTestRunner(final String aHost, final int aPort) throws UnknownHostException, IOException {
updateStatus("Connecting...");
boolean tempSuccessful = false;
try {
client = new IntegrityRemotingClient(aHost, aPort, new RemotingListener(), null);
tempSuccessful = true;
updateStatus("Connected, downloading test data...");
} finally {
if (!tempSuccessful) {
updateStatus("Not connected");
}
}
client = new IntegrityRemotingClient(aHost, aPort, new RemotingListener(), null);
// If we arrive here without an exception throwing us out, we are connected
updateStatus("Connected, downloading test data...");
}

private void disconnectFromTestRunner() {
Expand Down

0 comments on commit 728a5ff

Please sign in to comment.