Skip to content

Commit

Permalink
fix: ignore SocketException and SocketTimeoutException in logging
Browse files Browse the repository at this point in the history
  • Loading branch information
almax07082005 committed Dec 3, 2024
1 parent c0aa997 commit a634331
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.net.SocketException;
import java.net.SocketTimeoutException;
import java.util.Arrays;

@Component
Expand All @@ -16,6 +18,10 @@ public Logger(LogConfig log) {
}

public void logException(Exception exception) {
if (exception instanceof SocketException || exception instanceof SocketTimeoutException) {
return;
}

log.error(exception.getMessage() +
"\n" +
String.join("\n", Arrays
Expand Down

0 comments on commit a634331

Please sign in to comment.