code: static void rethrowIrrecoverableConnectionFailures(IOException e) throws SlaveRegistrationException {
          Throwable cause = e;
          while ((cause = cause.getCause()) != null) {
              if (cause instanceof SaslException) {
                  throw HostControllerLogger.ROOT_LOGGER.authenticationFailureUnableToConnect(cause);
              } else if (cause instanceof SSLHandshakeException) {
                  throw HostControllerLogger.ROOT_LOGGER.sslFailureUnableToConnect(cause);
              } else if (cause instanceof SlaveRegistrationException) {
                  throw (SlaveRegistrationException) cause;
              }
          }
      }
docs: Analyzes a failure thrown connecting to the master for causes that indicate
  some problem not likely to be resolved by immediately retrying. If found,
  throws an exception highlighting the underlying cause. If the cause is not
  one of the ones understood by this method, the method returns normally.
  
  @throws org.jboss.as.domain.controller.SlaveRegistrationException if the remote HC rejected the request
  @throws IllegalStateException for other failures understood by this method