diff options
| author | Simon Rettberg | 2025-07-02 14:40:24 +0200 |
|---|---|---|
| committer | Simon Rettberg | 2025-07-02 14:40:24 +0200 |
| commit | 2f57ea8f6de0053a8afbeb0023ae248c4444149d (patch) | |
| tree | 61d50e3ee8e4b741dad82378da7a45ef0d1721eb /dozentenmodulserver/src | |
| parent | [server] Only delete orphaned files at least 2 days old (diff) | |
| download | tutor-module-2f57ea8f6de0053a8afbeb0023ae248c4444149d.tar.gz tutor-module-2f57ea8f6de0053a8afbeb0023ae248c4444149d.tar.xz tutor-module-2f57ea8f6de0053a8afbeb0023ae248c4444149d.zip | |
[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.
Diffstat (limited to 'dozentenmodulserver/src')
| -rw-r--r-- | dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/web/WebRpc.java | 10 |
1 files changed, 2 insertions, 8 deletions
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; } |
