RFR: 8204256: improve jlink error message to report unsupported class file format [v2]
Mandy Chung
mchung at openjdk.java.net
Fri Oct 2 21:56:38 UTC 2020
On Fri, 2 Oct 2020 09:34:59 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Given that linking with JMODs of an unsupported class file version is rare case,
>> it's not a bad choice to go with this simplest solution printing the stack trace.
>
> What if we removed the handling of specific exceptions from L278-L285 so that the special handling is limited to
> BadArgs? If anything other than BadArgs is throw then it can print the exception to log output along with the cause (if
> not null). No objection. That might avoid the tool emitting a "scary" stack trace when an error occurs.
I think for `ResolutionException` and IAE (and possibly `PluginException`), the exception message should be helpful
enough to correct for example user-errors and that's why this special catch block.
Having another look, I think `FindException` may just fall into the last `Throwable` handler. The new catch block may
not be needed.
-------------
PR: https://git.openjdk.java.net/jdk/pull/409
More information about the core-libs-dev
mailing list