code: private Object handleFailOver(SQLException qe, Method method, Object[] args, Protocol protocol)
        throws Throwable {
      HostAddress failHostAddress = null;
      boolean failIsMaster = true;
      if (protocol != null) {
        failHostAddress = protocol.getHostAddress();
        failIsMaster = protocol.isMasterConnection();
      }
  
      HandleErrorResult handleErrorResult = listener.handleFailover(qe, method, args, protocol);
      if (handleErrorResult.mustThrowError) {
        listener
            .throwFailoverMessage(failHostAddress, failIsMaster, qe, handleErrorResult.isReconnected);
      }
      return handleErrorResult.resultObject;
    }
docs: After a connection exception, launch failover.
  
  @param qe     the exception thrown
  @param method the method to call if failover works well
  @param args   the arguments of the method
  @return the object return from the method
  @throws Throwable throwable