Skip to content

Commit

Permalink
handled "Connection reset by peer" in a special way
Browse files Browse the repository at this point in the history
  • Loading branch information
EinsamHauer committed Feb 4, 2021
1 parent 236a935 commit d702a7c
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import net.iponweb.disthene.reader.handler.DistheneReaderHandler;
import org.apache.log4j.Logger;

import java.io.IOException;
import java.util.Map;
import java.util.regex.Pattern;

Expand Down Expand Up @@ -95,7 +96,12 @@ public void channelReadComplete(ChannelHandlerContext ctx) {

@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
logger.error("Exception while processing request", cause);
// the check below is mostly because of "Connection reset by peer" exceptions overwhelming the log
if (cause instanceof IOException) {
logger.trace("Exception while processing request", cause);
} else {
logger.error("Exception while processing request", cause);
}
ctx.close();
}
}

0 comments on commit d702a7c

Please sign in to comment.