http-client-branch: added some comments to test/jdk/java/net/httpclient/ThrowingSubscribers.java http-client-branch
authordfuchs
Tue, 13 Mar 2018 10:39:26 +0000
branchhttp-client-branch
changeset 56286 3d8333fa243b
parent 56282 10cebcd18d47
child 56288 2de1aa88cf06
http-client-branch: added some comments to test/jdk/java/net/httpclient/ThrowingSubscribers.java
test/jdk/java/net/httpclient/ThrowingSubscribers.java
--- a/test/jdk/java/net/httpclient/ThrowingSubscribers.java	Tue Mar 13 10:21:57 2018 +0000
+++ b/test/jdk/java/net/httpclient/ThrowingSubscribers.java	Tue Mar 13 10:39:26 2018 +0000
@@ -343,8 +343,21 @@
     {
         HttpClient client = null;
         for (Where where : Where.values()) {
+
+            // Throwing on onSubscribe needs some more work
+            // for the case of InputStream, where the body has already
+            // completed by the time the subscriber is subscribed.
+            // The only way we have at that point to relay the exception
+            // is to call onError on the subscriber, but should we if
+            // Subscriber::onSubscribed has thrown an exception and
+            // not completed normally?
             if (where == Where.ON_SUBSCRIBE) continue;
+
+            // Don't know how to make the stack reliably cause onError
+            // to be called without closing the connection.
+            // And how do we get the exception if onError throws anyway?
             if (where == Where.ON_ERROR) continue;
+
             if (!sameClient || client == null)
                 client = newHttpClient(sameClient);