public int addDoc()

in encryption/src/main/java/org/apache/solr/update/DirectUpdateHandler2Copy.java [299:334]


  public int addDoc(AddUpdateCommand cmd) throws IOException {
    TestInjection.injectDirectUpdateLatch();
    try {
      return addDoc0(cmd);
    } catch (SolrException e) {
      throw e;
    } catch (AlreadyClosedException e) {
      throw new SolrException(
        SolrException.ErrorCode.SERVER_ERROR,
        String.format(
          Locale.ROOT,
          "Server error writing document id %s to the index",
          cmd.getPrintableId()),
        e);
    } catch (IllegalArgumentException iae) {
      throw new SolrException(
        SolrException.ErrorCode.BAD_REQUEST,
        String.format(
          Locale.ROOT,
          "Exception writing document id %s to the index; possible analysis error: "
            + iae.getMessage()
            + (iae.getCause() instanceof BytesRefHash.MaxBytesLengthExceededException
            ? ". Perhaps the document has an indexed string field (solr.StrField) which is too large"
            : ""),
          cmd.getPrintableId()),
        iae);
    } catch (RuntimeException t) {
      throw new SolrException(
        SolrException.ErrorCode.BAD_REQUEST,
        String.format(
          Locale.ROOT,
          "Exception writing document id %s to the index; possible analysis error.",
          cmd.getPrintableId()),
        t);
    }
  }