Use NoSuchBufferException instead of IllegalArgumentException

This commit is contained in:
Trustin Lee 2012-06-03 04:26:11 -07:00
parent 13d7ee1b2f
commit bbed0602c1

View File

@ -1146,9 +1146,7 @@ public class DefaultChannelPipeline implements ChannelPipeline {
out = directOutbound;
if (out.hasByteBuffer()) {
if(!(message instanceof ChannelBuffer)) {
throw new IllegalArgumentException(
"cannot write a message whose type is not " +
ChannelBuffer.class.getSimpleName() + ": " + message.getClass().getName());
throw new NoSuchBufferException();
}
} else {
msgBuf = true;