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:
parent
4e2bc95ef9
commit
c4bb0ea926
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user