This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 1f90e3ddebae9e42e4859ab3149f594f2bdc5af9 Author: Mark Thomas <ma...@apache.org> AuthorDate: Fri Jan 27 16:07:19 2023 +0000 Improve exception handling to avoid SpotBugs warning --- java/org/apache/naming/factory/SendMailFactory.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/java/org/apache/naming/factory/SendMailFactory.java b/java/org/apache/naming/factory/SendMailFactory.java index 57b1fcd3f6..e961f47df7 100644 --- a/java/org/apache/naming/factory/SendMailFactory.java +++ b/java/org/apache/naming/factory/SendMailFactory.java @@ -26,6 +26,8 @@ import javax.naming.RefAddr; import javax.naming.Reference; import javax.naming.spi.ObjectFactory; +import org.apache.tomcat.util.ExceptionUtils; + import jakarta.mail.Session; import jakarta.mail.internet.InternetAddress; import jakarta.mail.internet.MimeMessage; @@ -109,7 +111,10 @@ public class SendMailFactory implements ObjectFactory message.setFrom(new InternetAddress(from)); } message.setSubject(""); - } catch (Exception e) {/*Ignore*/} + } catch (Throwable t) { + ExceptionUtils.handleThrowable(t); + // Otherwise ignore + } MimePartDataSource mds = new MimePartDataSource(message); return mds; } else { // We can't create an instance of the DataSource --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org