Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ private static void configureMailer() {
Class<? extends Mail> cobj = Class.forName(clazz).asSubclass(Mail.class);
mailer = cobj.getDeclaredConstructor().newInstance();
}
catch (Exception e) {
catch (Exception | LinkageError e) {
log.error("An exception was thrown while initializing custom mailer class", e);
mailer = new SmtpMail();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ public void execute(EventMessage msg) {
* @return the mailer associated with this class
*/
protected Mail getMail() {
String clazz = Config.get().getString(
"web.mailer_class");
String clazz = Config.get().getString("web.mailer_class");
if (clazz == null) {
return new SmtpMail();
}
try {
Class cobj = Class.forName(clazz);
return (Mail) cobj.newInstance();
Class<? extends Mail> cobj = Class.forName(clazz).asSubclass(Mail.class);
return cobj.getDeclaredConstructor().newInstance();
}
catch (Exception e) {
catch (Exception | LinkageError e) {
getLogger().error("An exception was thrown while initializing custom mailer class", e);
return new SmtpMail();
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix server error when visiting the notifications page