src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/RequestPublishers.java
--- 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);
}