From 2f57ea8f6de0053a8afbeb0023ae248c4444149d Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 2 Jul 2025 14:40:24 +0200 Subject: [server] Thrown exceptions changed in recent Java versions WebRpc.java:[245.27] exception java.io.IOException is never thrown in body of corresponding try statement Thanks Java. -> Just generically catch "Exception", not individual ones which might change nilly willy with future JRE versions. --- .../src/main/java/org/openslx/bwlp/sat/web/WebRpc.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'dozentenmodulserver/src/main/java') diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/web/WebRpc.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/web/WebRpc.java index 768a7f17..8f35a0e3 100644 --- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/web/WebRpc.java +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/web/WebRpc.java @@ -8,9 +8,6 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.security.spec.InvalidKeySpecException; import java.sql.SQLException; import java.util.HashMap; import java.util.Map; @@ -18,8 +15,6 @@ import java.util.Map.Entry; import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; -import javax.security.auth.login.LoginException; - import org.apache.commons.io.output.ByteArrayOutputStream; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -238,12 +233,11 @@ public class WebRpc { try { smtpc = new SmtpMailer(host, port, ssl, senderAddress, serverName, replyTo, username, password, new PrintStream(baos)); - } catch (InvalidKeyException | LoginException | NoSuchAlgorithmException | InvalidKeySpecException - | IOException e) { + } catch (Exception e) { try { baos.write("Could not connect to mail server".getBytes(StandardCharsets.UTF_8)); e.printStackTrace(new PrintWriter(baos)); - } catch (IOException e1) { + } catch (Exception e1) { } smtpc = null; } -- cgit v1.2.3-55-g7522