mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-23 23:30:50 +01:00
Fix exception spam on busy hotels.
This commit is contained in:
parent
2bc4bc3473
commit
401af627ff
@ -11,6 +11,8 @@ import io.netty.handler.codec.TooLongFrameException;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
@ChannelHandler.Sharable
|
@ChannelHandler.Sharable
|
||||||
public class GameMessageHandler extends ChannelInboundHandlerAdapter {
|
public class GameMessageHandler extends ChannelInboundHandlerAdapter {
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(GameMessageHandler.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(GameMessageHandler.class);
|
||||||
@ -53,6 +55,11 @@ public class GameMessageHandler extends ChannelInboundHandlerAdapter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
|
||||||
|
if (cause instanceof IOException) {
|
||||||
|
ctx.channel().close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (cause instanceof TooLongFrameException) {
|
if (cause instanceof TooLongFrameException) {
|
||||||
LOGGER.error("Disconnecting client, reason: \"" + cause.getMessage() + "\".");
|
LOGGER.error("Disconnecting client, reason: \"" + cause.getMessage() + "\".");
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user