More helpful IllegalArgumentException message

This commit is contained in:
Trustin Lee 2012-11-12 16:02:30 +09:00
parent b3be15204d
commit 45de76f58d

View File

@ -98,7 +98,8 @@ public class ServerBootstrap extends AbstractBootstrap<ServerBootstrap> {
throw new NullPointerException("channelClass");
}
if (!ServerChannel.class.isAssignableFrom(channelClass)) {
throw new IllegalArgumentException();
throw new IllegalArgumentException(
"channelClass must be subtype of " + ServerChannel.class.getSimpleName() + '.');
}
if (channelClass == AioServerSocketChannel.class) {
return channelFactory(new AioServerSocketChannelFactory());