Skip to content

Commit

Permalink
Generalize catch to SocketException (#839)
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick authored Sep 19, 2024
1 parent a79e418 commit 53b76bc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/jvnet/hudson/test/RealJenkinsRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
import java.io.Serializable;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.net.ConnectException;
import java.net.HttpURLConnection;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.SocketException;
import java.net.URI;
import java.net.URL;
import java.net.URLClassLoader;
Expand Down Expand Up @@ -933,8 +933,8 @@ public void stopJenkins() throws Throwable {
if (_proc.isAlive()) {
try {
endpoint("exit").openStream().close();
} catch (ConnectException e) {
System.err.println("Unable to connect to the Jenkins process to stop it.");
} catch (SocketException e) {
System.err.println("Unable to connect to the Jenkins process to stop it: " + e);
}
} else {
System.err.println("Jenkins process was already terminated.");
Expand Down

0 comments on commit 53b76bc

Please sign in to comment.