KEYCLOAK-9837 Not hide exception in email templating - clean code

This commit is contained in:
Domenico Briganti 2020-01-10 11:21:12 +01:00 committed by Stian Thorgersen
parent f07e08ef28
commit 812b69af13

View file

@ -55,7 +55,6 @@ import org.keycloak.theme.beans.MessageFormatterMethod;
*/
public class FreeMarkerEmailTemplateProvider implements EmailTemplateProvider {
private static final Logger logger = Logger.getLogger(FreeMarkerEmailTemplateProvider.class);
protected KeycloakSession session;
/**
* authenticationSession can be null for some email sendings, it is filled only for email sendings performed as part of the authentication session (email verification, password reset, broker link
@ -218,7 +217,6 @@ public class FreeMarkerEmailTemplateProvider implements EmailTemplateProvider {
try {
textBody = freeMarker.processTemplate(attributes, textTemplate, theme);
} catch (final FreeMarkerException e) {
textBody = null;
throw new EmailException("Failed to template plain text email.", e);
}
String htmlTemplate = String.format("html/%s", template);
@ -226,7 +224,6 @@ public class FreeMarkerEmailTemplateProvider implements EmailTemplateProvider {
try {
htmlBody = freeMarker.processTemplate(attributes, htmlTemplate, theme);
} catch (final FreeMarkerException e) {
htmlBody = null;
throw new EmailException("Failed to template html email.", e);
}