Merge pull request #10130 from apupier:10128-provideMorePreciseErrorMessage
* pr/10130: Polish "Improve exception message for invalid source" Improve exception message for invalid source
This commit is contained in:
@@ -78,8 +78,12 @@ 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 file must be provided");
|
||||
}
|
||||
if (!source.exists() || !source.isFile()) {
|
||||
throw new IllegalArgumentException("Source must refer to an existing file, "
|
||||
+ "got " + source.getAbsolutePath());
|
||||
}
|
||||
this.source = source.getAbsoluteFile();
|
||||
this.layoutFactory = layoutFactory;
|
||||
|
||||
Reference in New Issue
Block a user