public void scheduledQueryDelete(ScheduledQuery scheduledQuery) throws NoSuchObjectException, AlreadyExistsException {
    MScheduledQuery schq = MScheduledQuery.fromThrift(scheduledQuery);
    boolean commited = false;
    try {
      openTransaction();
      Optional<MScheduledQuery> existing = getMScheduledQuery(scheduledQuery.getScheduleKey());
      if (!existing.isPresent()) {
        throw new NoSuchObjectException(
            "Scheduled query with name: " + scheduledQueryKeyRef(schq.getScheduleKey()) + " doesn't exists.");
      }
      MScheduledQuery persisted = existing.get();
      pm.deletePersistent(persisted);
      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