File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
java/code/src/com/redhat/rhn Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ private static void configureMailer() {
7878 mailer = cobj .getDeclaredConstructor ().newInstance ();
7979 }
8080 catch (Throwable e ) {
81- log .warn ("An exception was thrown while configuring Mailer " , e );
81+ log .error ("An exception was thrown while initializing custom mailer class " , e );
8282 mailer = new SmtpMail ();
8383 }
8484 }
Original file line number Diff line number Diff line change @@ -52,16 +52,16 @@ public void execute(EventMessage msg) {
5252 * @return the mailer associated with this class
5353 */
5454 protected Mail getMail () {
55- String clazz = Config .get ().getString (
56- "web.mailer_class" );
55+ String clazz = Config .get ().getString ("web.mailer_class" );
5756 if (clazz == null ) {
5857 return new SmtpMail ();
5958 }
6059 try {
61- Class cobj = Class .forName (clazz );
62- return ( Mail ) cobj .newInstance ();
60+ Class <? extends Mail > cobj = Class .forName (clazz ). asSubclass ( Mail . class );
61+ return cobj . getDeclaredConstructor () .newInstance ();
6362 }
64- catch (Exception e ) {
63+ catch (Throwable e ) {
64+ getLogger ().error ("An exception was thrown while initializing custom mailer class" , e );
6565 return new SmtpMail ();
6666 }
6767 }
You can’t perform that action at this time.
0 commit comments