On Fri, 6 Nov 2020 09:52:54 GMT, Chris Hegarty <che...@openjdk.org> wrote:
>> This is executed on the server side - the Throwable here is the >> AssertionError thrown by expectThrows if the expected exception is not >> thrown. It is important to return this to the client side so that the client >> side (main thread) can fail properly. > > Oh, ok. So the whole purpose of the catch block is to gracefully terminate > things (and trigger error reporting) if the test fails - which it should > never do ;-) Ok, thanks. [ It's almost like the code would be more easily > understood if written without expectThrows, in this particular case ] > // unexpected exception thrown, return error to client The comment is a bit misleading. Maybe it should say: // expectThrows triggered an assertion, return error message to the client. ------------- PR: https://git.openjdk.java.net/jdk/pull/1014