# HG changeset patch # User dfuchs # Date 1520937566 0 # Node ID 3d8333fa243b53cd0f069e1eb2d07f446776ffcf # Parent 10cebcd18d47d96088a4ce6c2db3afc93b2e9cac http-client-branch: added some comments to test/jdk/java/net/httpclient/ThrowingSubscribers.java diff -r 10cebcd18d47 -r 3d8333fa243b 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);