diff --git a/core/src/main/java/org/wildfly/extras/creaper/core/online/OnlineManagementClientImpl.java b/core/src/main/java/org/wildfly/extras/creaper/core/online/OnlineManagementClientImpl.java index 20d1d620..2c1511c4 100644 --- a/core/src/main/java/org/wildfly/extras/creaper/core/online/OnlineManagementClientImpl.java +++ b/core/src/main/java/org/wildfly/extras/creaper/core/online/OnlineManagementClientImpl.java @@ -59,14 +59,18 @@ private void connect() throws IOException { try { this.version = OnlineServerVersion.discover(client); checkStandaloneVsDomain(); - } catch (IOException e) { + } catch (Exception e) { try { client.close(); cliContext.disconnectController(); } catch (IOException ignored) { // so that it doesn't suppress the original exception } - throw e; + if (e instanceof IOException) { + throw (IOException) e; + } else { + throw (RuntimeException) e; + } } }