static void resolveException(Throwable t, ThriftClient o) {
    Throwable origin = t;
    if (t instanceof InvocationTargetException) {
      origin = ((InvocationTargetException) t).getTargetException();
    }
    Throwable cur = origin;
    if (cur instanceof TException) {
      int level = 0;
      while (cur != null) {
        logger.debug(
            "level-{} Exception class {}, message {}",
            level,
            cur.getClass().getName(),
            cur.getMessage());
        cur = cur.getCause();
        level++;
      }
      o.invalidate();
    }

    Throwable rootCause = ExceptionUtils.getRootCause(origin);
    if (rootCause != null) {
      // if the exception is SocketException and its error message is Broken pipe, it means that
      // the remote node may restart and all the connection we cached before should be cleared.
      logger.debug(
          "root cause message {}, LocalizedMessage {}, ",
          rootCause.getMessage(),
          rootCause.getLocalizedMessage(),
          rootCause);
      if (isConnectionBroken(rootCause)) {
        if (o.printLogWhenEncounterException()) {
          logger.info(
              "Broken pipe error happened in sending RPC,"
                  + " we need to clear all previous cached connection, error msg is {}",
              rootCause.toString());
        }
        o.invalidateAll();
      }
    }
  }
Perform corresponding operations on ThriftClient o based on the Throwable t.

@param t Throwable
@param o ThriftClient
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ThriftClient.java