Polish "Improve exception message for invalid source"

Closes gh-10130
This commit is contained in:
Stephane Nicoll 2017-09-07 09:43:21 +02:00
parent 44b60c72e3
commit af18110226
1 changed files with 3 additions and 2 deletions

View File

@ -79,10 +79,11 @@ public class Repackager {
public Repackager(File source, LayoutFactory layoutFactory) { public Repackager(File source, LayoutFactory layoutFactory) {
if (source == null) { 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()) { 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.source = source.getAbsoluteFile();
this.layoutFactory = layoutFactory; this.layoutFactory = layoutFactory;