# HG changeset patch # User jlaskey # Date 1478543787 14400 # Node ID 3e89e6103470e7ac0a236c69dd0752be170dacd8 # Parent 31f5023200d42185b70c4c00ba5672391e4642d0 8155756: Better context for some jlink exceptions Reviewed-by: mchung diff -r 31f5023200d4 -r 3e89e6103470 jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/DirArchive.java --- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/DirArchive.java Wed Jul 05 22:26:06 2017 +0200 +++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/DirArchive.java Mon Nov 07 14:36:27 2016 -0400 @@ -92,7 +92,7 @@ public DirArchive(Path dirPath, Consumer log) { Objects.requireNonNull(dirPath); if (!Files.isDirectory(dirPath)) { - throw new IllegalArgumentException("Not a directory"); + throw new IllegalArgumentException(dirPath + " is not a directory"); } chop = dirPath.toString().length() + 1; this.moduleName = Objects.requireNonNull(dirPath.getFileName()).toString(); diff -r 31f5023200d4 -r 3e89e6103470 jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java --- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java Wed Jul 05 22:26:06 2017 +0200 +++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java Mon Nov 07 14:36:27 2016 -0400 @@ -212,7 +212,7 @@ mainOptions.add(new PlugOption(true, (task, opt, arg) -> { Path path = Paths.get(arg); if (!Files.exists(path) || !Files.isDirectory(path)) { - throw newBadArgs("err.image.must.exist"); + throw newBadArgs("err.image.must.exist", path); } existingImage = path.toAbsolutePath(); }, true, POST_PROCESS)); diff -r 31f5023200d4 -r 3e89e6103470 jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties --- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties Wed Jul 05 22:26:06 2017 +0200 +++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties Mon Nov 07 14:36:27 2016 -0400 @@ -91,7 +91,7 @@ err.mods.must.be.specified:no modules specified to {0} err.path.not.found=path not found: {0} err.path.not.valid=invalid path: {0} -err.image.must.exist=image does not exist or is not a directory +err.image.must.exist=image {0} does not exist or is not a directory err.existing.image.invalid=existing image is not valid err.file.not.found=cannot find file: {0} err.file.error=cannot access file: {0}