public void scheduledQueryInsert(ScheduledQuery scheduledQuery)
      throws NoSuchObjectException, AlreadyExistsException, InvalidInputException {
    MScheduledQuery schq = MScheduledQuery.fromThrift(scheduledQuery);
    boolean commited = false;
    try {
      Optional<MScheduledQuery> existing = getMScheduledQuery(scheduledQuery.getScheduleKey());
      if (existing.isPresent()) {
        throw new AlreadyExistsException(
            "Scheduled query with name: " + scheduledQueryKeyRef(scheduledQuery.getScheduleKey()) + " already exists.");
      }
      openTransaction();
      Integer nextExecutionTime = computeNextExecutionTime(schq.getSchedule());
      schq.setNextExecution(nextExecutionTime);
      pm.makePersistent(schq);
      commited = commitTransaction();
    } finally {
      rollbackAndCleanup(commited, null);
    }
  }
Abbreviates the error message to the given size.

There might be error messages which may also contain a stack trace.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java