mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-11-24 11:36:51 +01:00
Add some debug information to the mssing decoder/encoder exception.
This commit is contained in:
parent
be95fbc430
commit
feae8dd400
@ -188,7 +188,7 @@ class ChannelInjector extends ByteToMessageDecoder {
|
||||
synchronized (networkManager) {
|
||||
if (originalChannel instanceof Factory)
|
||||
return false;
|
||||
|
||||
|
||||
// Don't inject the same channel twice
|
||||
if (findChannelHandler(originalChannel, ChannelInjector.class) != null) {
|
||||
// Invalidate cache
|
||||
@ -202,9 +202,9 @@ class ChannelInjector extends ByteToMessageDecoder {
|
||||
vanillaEncoder = (MessageToByteEncoder<Object>) originalChannel.pipeline().get("encoder");
|
||||
|
||||
if (vanillaDecoder == null)
|
||||
throw new IllegalArgumentException("Unable to find vanilla decoder.in " + originalChannel.pipeline());
|
||||
throw new IllegalArgumentException("Unable to find vanilla decoder.in " + originalChannel.pipeline() + ". " + getChannelState());
|
||||
if (vanillaEncoder == null)
|
||||
throw new IllegalArgumentException("Unable to find vanilla encoder in " + originalChannel.pipeline());
|
||||
throw new IllegalArgumentException("Unable to find vanilla encoder in " + originalChannel.pipeline() + ". " + getChannelState());
|
||||
patchEncoder(vanillaEncoder);
|
||||
|
||||
if (DECODE_BUFFER == null)
|
||||
@ -245,6 +245,10 @@ class ChannelInjector extends ByteToMessageDecoder {
|
||||
}
|
||||
}
|
||||
|
||||
private String getChannelState() {
|
||||
return "Registered channel: " + originalChannel.isRegistered() + ", Active channel: " + originalChannel.isActive() + ", Open channel: " + originalChannel.isOpen();
|
||||
}
|
||||
|
||||
/**
|
||||
* Process a given message on the packet listeners.
|
||||
* @param message - the message/packet.
|
||||
|
Loading…
Reference in New Issue
Block a user