use of org.summerb.approaches.jdbccrud.api.exceptions.GenericEntityNotFoundException in project summerb by skarpushin.
the class ArticleRenderingContext method getReferencedArticle.
protected Article getReferencedArticle(String articleKey) throws GenericEntityNotFoundException {
if (referencedArticles.containsKey(articleKey)) {
return referencedArticles.get(articleKey);
}
try {
Article ret = articleService.findArticleByKeyAndLocale(articleKey, locale);
if (ret == null) {
throw new GenericEntityNotFoundException("article", articleKey);
}
referencedArticles.put(articleKey, ret);
registerReferencedArticle(ret.getId());
return ret;
} catch (Throwable e) {
Throwables.throwIfInstanceOf(e, GenericEntityNotFoundException.class);
throw new RuntimeException("Failed to find effective referenced article permutation " + articleKey, e);
}
}
Aggregations