From af1811022683d74333f98a4fc0a96e8649a3c5fa Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Thu, 7 Sep 2017 09:43:21 +0200 Subject: [PATCH] Polish "Improve exception message for invalid source" Closes gh-10130 --- .../org/springframework/boot/loader/tools/Repackager.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java index e4c5fd12bc..0051ca6f44 100644 --- a/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java +++ b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java @@ -79,10 +79,11 @@ public class Repackager { public Repackager(File source, LayoutFactory layoutFactory) { if (source == null) { - throw new IllegalArgumentException("Source must refer to an existing file. No source file has been provided."); + throw new IllegalArgumentException("Source file must be provided"); } if (!source.exists() || !source.isFile()) { - throw new IllegalArgumentException("Source must refer to an existing file. Provided value is " + source.getAbsolutePath()); + throw new IllegalArgumentException("Source must refer to an existing file, " + + "got " + source.getAbsolutePath()); } this.source = source.getAbsoluteFile(); this.layoutFactory = layoutFactory;