Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Handle unresolved addresss and return same error as moar.
  • Loading branch information
donaldh committed Jun 5, 2014
1 parent 2180903 commit bbaf492
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -6,6 +6,7 @@
import java.nio.channels.AsynchronousSocketChannel;
import java.nio.channels.CompletionHandler;
import java.nio.channels.NotYetBoundException;
import java.nio.channels.UnresolvedAddressException;

import org.perl6.nqp.runtime.ExceptionHandling;
import org.perl6.nqp.runtime.HLLConfig;
Expand Down Expand Up @@ -33,6 +34,8 @@ public void bind(ThreadContext tc, String host, int port) {
try {
InetSocketAddress addr = new InetSocketAddress(host, port);
listenChan.bind(addr);
} catch (UnresolvedAddressException uae) {
ExceptionHandling.dieInternal(tc, "Failed to resolve host name");
} catch (IOException e) {
throw ExceptionHandling.dieInternal(tc, e);
}
Expand Down

0 comments on commit bbaf492

Please sign in to comment.