Skip to content

Commit

Permalink
Merge pull request #568 from kwin/template-engines-loading-resilience
Browse files Browse the repository at this point in the history
Catch all classloading issues
  • Loading branch information
jonbullock committed Nov 15, 2018
2 parents aebf496 + 0f8adbf commit 1903219
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ private static AbstractTemplateEngine tryLoadEngine(final JBakeConfiguration con
Class<? extends AbstractTemplateEngine> engineClass = (Class<? extends AbstractTemplateEngine>) Class.forName(engineClassName, false, TemplateEngines.class.getClassLoader());
Constructor<? extends AbstractTemplateEngine> ctor = engineClass.getConstructor(JBakeConfiguration.class, ContentStore.class);
return ctor.newInstance(config, db);
} catch (Exception e) {
LOGGER.error("unable to load engine", e);
} catch (Throwable e) {
// not all engines might be necessary, therefore only emit class loading issue with level warn
LOGGER.warn("unable to load engine", e);
return null;
}
}
Expand Down

0 comments on commit 1903219

Please sign in to comment.