jdk/src/java.httpclient/share/classes/java/net/http/WSOpeningHandshake.java
changeset 38322 f6f9d3ec14ba
parent 37874 02589df0999a
child 39133 b5641ce64cf7
--- a/jdk/src/java.httpclient/share/classes/java/net/http/WSOpeningHandshake.java	Mon May 16 15:10:04 2016 +0100
+++ b/jdk/src/java.httpclient/share/classes/java/net/http/WSOpeningHandshake.java	Mon May 16 16:04:14 2016 +0100
@@ -24,6 +24,8 @@
  */
 package java.net.http;
 
+import java.io.UncheckedIOException;
+import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.nio.charset.StandardCharsets;
@@ -126,6 +128,8 @@
                         return CompletableFuture.completedFuture(result);
                     } catch (WebSocketHandshakeException e) {
                         return CompletableFuture.failedFuture(e);
+                    } catch (UncheckedIOException ee) {
+                        return CompletableFuture.failedFuture(ee.getCause());
                     }
                 });
     }
@@ -149,7 +153,12 @@
         checkAccept(response, h);
         checkExtensions(response, h);
         String subprotocol = checkAndReturnSubprotocol(response, h);
-        RawChannel channel = ((HttpResponseImpl) response).rawChannel();
+        RawChannel channel = null;
+        try {
+            channel = ((HttpResponseImpl) response).rawChannel();
+        } catch (IOException e) {
+            throw new UncheckedIOException(e);
+        }
         return new Result(subprotocol, channel);
     }