Skip to content

Commit

Permalink
Catch and log exceptions in executor thread
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarian2 committed Jun 26, 2024
1 parent 72b1866 commit 79536cd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/com/mimecast/robin/smtp/SmtpListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ private void acceptConnection() {
log.info("Accepted connection from {}:{}.", sock.getInetAddress().getHostAddress(), sock.getPort());

executor.submit(() -> {
new EmailReceipt(sock).run();
try {
new EmailReceipt(sock).run();
} catch (Exception e) {
log.error("Email receipt unexpected exception: {}", e.getMessage());
}
return null;
});
} while (!serverShutdown);
Expand Down

0 comments on commit 79536cd

Please sign in to comment.