code: private void buildErrorStatus(BatchResult result, Throwable ex) {
          result.setStatus(BatchResult.Status.ERROR);
          result.setErrorMessage(ex.getLocalizedMessage());
          if (ex instanceof IllegalArgumentException) {
              m_logger.debug("Batch update error: {}", ex.toString());
          } else {
              result.setStackTrace(Utils.getStackTrace(ex));
              m_logger.debug("Batch update error: {} stacktrace: {}",
                             ex.toString(), Utils.getStackTrace(ex));
          }
      }
docs: Add error fields to the given BatchResult due to the given exception.