src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/RequestPublishers.java
branchhttp-client-branch
changeset 55777 e62cbcc08cae
parent 55763 634d8e14c172
child 55792 0936888d5a4a
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/RequestPublishers.java	Tue Nov 07 19:46:59 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/RequestPublishers.java	Wed Nov 08 09:34:56 2017 +0000
@@ -329,13 +329,14 @@
 
         @Override
         public void subscribe(Flow.Subscriber<? super ByteBuffer> subscriber) {
-
+            PullPublisher<ByteBuffer> publisher;
             InputStream is = streamSupplier.get();
             if (is == null) {
-                throw new UncheckedIOException(new IOException("no inputstream supplied"));
+                Throwable t = new IOException("streamSupplier returned null");
+                publisher = new PullPublisher<>(null, t);
+            } else  {
+                publisher = new PullPublisher<>(iterableOf(is), null);
             }
-            PullPublisher<ByteBuffer> publisher =
-                    new PullPublisher<>(iterableOf(is));
             publisher.subscribe(subscriber);
         }