public Optional<MScheduledQuery> getMScheduledQuery(ScheduledQueryKey key) {
    MScheduledQuery s = null;
    boolean commited = false;
    Query query = null;
    try {
      openTransaction();
      query = pm.newQuery(MScheduledQuery.class, "scheduleName == sName && clusterNamespace == ns");
      query.declareParameters("java.lang.String sName, java.lang.String ns");
      query.setUnique(true);
      s = (MScheduledQuery) query.execute(key.getScheduleName(), key.getClusterNamespace());
      pm.retrieve(s);
      commited = commitTransaction();
    } finally {
      rollbackAndCleanup(commited, query);
    }
    return Optional.ofNullable(s);
  }
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