Skip to content

Commit

Permalink
Report target connection failure more accurately
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Oct 19, 2020
1 parent 06163aa commit fdc3878
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@

import javax.inject.Provider;

import org.openjdk.jmc.rjmx.ConnectionException;

import com.redhat.rhjmc.containerjfr.core.ContainerJfrCore;
import com.redhat.rhjmc.containerjfr.core.log.Logger;
import com.redhat.rhjmc.containerjfr.core.net.Credentials;
Expand Down Expand Up @@ -301,12 +303,15 @@ public static void main(String[] args) {
StandardOpenOption.DSYNC,
StandardOpenOption.WRITE);
System.exit(ExitStatus.OK.code);
} catch (ConnectionException e) {
e.printStackTrace();
System.exit(ExitStatus.TARGET_CONNECTION_FAILURE.code);
} catch (IOException e) {
e.printStackTrace();
System.exit(ExitStatus.IO_EXCEPTION.code);
} catch (Exception e) {
e.printStackTrace();
System.exit(ExitStatus.TARGET_CONNECTION_FAILURE.code);
System.exit(ExitStatus.OTHER.code);
}
}

Expand Down

0 comments on commit fdc3878

Please sign in to comment.