Improve exception message for invalid source

See gh-10130
This commit is contained in:
Aurélien Pupier 2017-08-31 17:28:39 +02:00 committed by Stephane Nicoll
parent 86cd7275a1
commit 44b60c72e3

View File

@ -78,8 +78,11 @@ public class Repackager {
}
public Repackager(File source, LayoutFactory layoutFactory) {
if (source == null || !source.exists() || !source.isFile()) {
throw new IllegalArgumentException("Source must refer to an existing file");
if (source == null) {
throw new IllegalArgumentException("Source must refer to an existing file. No source file has been provided.");
}
if (!source.exists() || !source.isFile()) {
throw new IllegalArgumentException("Source must refer to an existing file. Provided value is " + source.getAbsolutePath());
}
this.source = source.getAbsoluteFile();
this.layoutFactory = layoutFactory;