public FragmentInstanceInfo getInstanceInfo() {
    FragmentInstanceState state = stateMachine.getState();
    long endTime = getEndTime();
    LinkedBlockingQueue<Throwable> failures = stateMachine.getFailureCauses();
    String failureCause = "";
    List<FragmentInstanceFailureInfo> failureInfoList = new ArrayList<>();
    TSStatus status = null;

    for (Throwable t : failures) {
      Throwable failure = getRootCause(t);
      if (failureCause.isEmpty()) {
        failureCause = failure.getMessage();
      }
      failureInfoList.add(FragmentInstanceFailureInfo.toFragmentInstanceFailureInfo(failure));
      if (failure instanceof IoTDBException) {
        status = new TSStatus(((IoTDBException) failure).getErrorCode());
        status.setMessage(failure.getMessage());
      } else if (failure instanceof IoTDBRuntimeException) {
        status = new TSStatus(((IoTDBRuntimeException) failure).getErrorCode());
        status.setMessage(failure.getMessage());
      } else if (failure instanceof DateTimeParseException) {
        status = new TSStatus(DATE_OUT_OF_RANGE.getStatusCode());
        status.setMessage(failure.getMessage());
      } else {
        LOGGER.warn("[Unknown exception]: ", failure);
      }
    }

    if (status == null) {
      return new FragmentInstanceInfo(state, endTime, failureCause, failureInfoList);
    } else {
      return new FragmentInstanceInfo(state, endTime, failureCause, failureInfoList, status);
    }
  }
return List of specific throwable and stack trace
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/FragmentInstanceContext.java