Skip to content

Commit 5d84e95

Browse files
Ian GravesMandy Chung
authored andcommitted
8204256: improve jlink error message to report unsupported class file format
Reviewed-by: mchung
1 parent 4fe68f5 commit 5d84e95

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ int run(String[] args) {
229229
List<String> remaining = optionsHelper.handleOptions(this, args);
230230
if (remaining.size() > 0 && !options.suggestProviders) {
231231
throw taskHelper.newBadArgs("err.orphan.arguments",
232-
remaining.stream().collect(Collectors.joining(" ")))
232+
remaining.stream().collect(Collectors.joining(" ")))
233233
.showUsage(true);
234234
}
235235
if (options.help) {
@@ -259,8 +259,8 @@ int run(String[] args) {
259259
}
260260

261261
if (options.modulePath.isEmpty()) {
262-
throw taskHelper.newBadArgs("err.modulepath.must.be.specified")
263-
.showUsage(true);
262+
throw taskHelper.newBadArgs("err.modulepath.must.be.specified")
263+
.showUsage(true);
264264
}
265265
}
266266

@@ -275,8 +275,12 @@ int run(String[] args) {
275275
}
276276

277277
return EXIT_OK;
278+
} catch (FindException e) {
279+
log.println(taskHelper.getMessage("err.prefix") + " " + e.getMessage());
280+
e.printStackTrace(log);
281+
return EXIT_ERROR;
278282
} catch (PluginException | IllegalArgumentException |
279-
UncheckedIOException |IOException | FindException | ResolutionException e) {
283+
UncheckedIOException |IOException | ResolutionException e) {
280284
log.println(taskHelper.getMessage("error.prefix") + " " + e.getMessage());
281285
if (DEBUG) {
282286
e.printStackTrace(log);

0 commit comments

Comments
 (0)