Add exception logging to forge channel handlers as well

MinecraftForge/FML@53557dcd05 Put logging exception handlers on all channel inbounds. Fix problem with failure to login. Closes #350
This commit is contained in:
Christian 2014-01-17 17:05:06 -05:00
parent b3d8e4ea68
commit eeeb4d37e8
3 changed files with 20 additions and 4 deletions

2
fml

@ -1 +1 @@
Subproject commit 9c96ca4402e4c231285f170281dd543bfffa191a
Subproject commit 53557dcd0582e09f7f35eb3bc2fd130fba3be4a0

View file

@ -1,10 +1,11 @@
package net.minecraftforge.common.network;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.network.ForgeMessage.DimensionRegisterMessage;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.network.ForgeMessage.DimensionRegisterMessage;
import org.apache.logging.log4j.Level;
import cpw.mods.fml.common.FMLLog;
public class DimensionMessageHandler extends SimpleChannelInboundHandler<ForgeMessage.DimensionRegisterMessage>{
@Override
@ -15,5 +16,11 @@ public class DimensionMessageHandler extends SimpleChannelInboundHandler<ForgeMe
DimensionManager.registerDimension(msg.dimensionId, msg.providerId);
}
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception
{
FMLLog.log(Level.ERROR, cause, "DimensionMessageHandler exception");
super.exceptionCaught(ctx, cause);
}
}

View file

@ -1,5 +1,7 @@
package net.minecraftforge.common.network;
import org.apache.logging.log4j.Level;
import cpw.mods.fml.common.FMLLog;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
@ -9,4 +11,11 @@ public class FluidIdRegistryMessageHandler extends SimpleChannelInboundHandler<F
{
// Do something with the message
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception
{
FMLLog.log(Level.ERROR, cause, "FluidIdRegistryMessageHandler exception");
super.exceptionCaught(ctx, cause);
}
}