--- a/test/jdk/java/net/httpclient/ThrowingSubscribers.java Thu Jun 07 10:45:30 2018 +0100
+++ b/test/jdk/java/net/httpclient/ThrowingSubscribers.java Thu Jun 07 14:21:50 2018 +0100
@@ -409,8 +409,12 @@
try {
response = client.send(req, handler);
} catch (Error | Exception t) {
- if (thrower.test(t)) {
- System.out.println(now() + "Got expected exception: " + t);
+ // synchronous send will rethrow exceptions
+ Throwable throwable = t.getCause();
+ assert throwable != null;
+
+ if (thrower.test(throwable)) {
+ System.out.println(now() + "Got expected exception: " + throwable);
} else throw causeNotFound(where, t);
}
}