Replace usage of UnknownHostException with UnresolveableAddressException. Part of [#2262]

Motivation:
We better use UnresolveableAddressException as NIO does the same.

Modifications:
Replace usage of UnknownHostException with UnresolveableAddressException

Result:
epoll transport and nio transport behave the same way
This commit is contained in:
Norman Maurer 2014-03-16 08:29:45 -07:00
parent 4e2bc95ef9
commit c4bb0ea926

View File

@ -23,7 +23,7 @@ import io.netty.channel.EventLoop;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;
import java.nio.channels.UnresolvedAddressException;
abstract class AbstractEpollChannel extends AbstractChannel {
private static final ChannelMetadata DATA = new ChannelMetadata(false);
@ -129,9 +129,9 @@ abstract class AbstractEpollChannel extends AbstractChannel {
@Override
protected abstract AbstractEpollUnsafe newUnsafe();
protected static void checkResolvable(InetSocketAddress addr) throws UnknownHostException {
protected static void checkResolvable(InetSocketAddress addr) {
if (addr.isUnresolved()) {
throw new UnknownHostException("Unable to resolve addr " + addr);
throw new UnresolvedAddressException();
}
}