Better error message when a RodBinding file doesn't exist
This commit is contained in:
parent
09a09cacef
commit
4108a294f7
|
|
@ -380,7 +380,7 @@ class RodBindingArgumentTypeDescriptor extends ArgumentTypeDescriptor {
|
||||||
|
|
||||||
if ( tribbleType == null )
|
if ( tribbleType == null )
|
||||||
if ( ! file.canRead() | ! file.isFile() ) {
|
if ( ! file.canRead() | ! file.isFile() ) {
|
||||||
throw new UserException.BadArgumentValue(name, "Couldn't read file to determine type: " + file);
|
throw new UserException.CouldNotReadInputFile(file, "file does exist or couldn't be read");
|
||||||
} else {
|
} else {
|
||||||
throw new UserException.CommandLineException(
|
throw new UserException.CommandLineException(
|
||||||
String.format("No tribble type was provided on the command line and the type of the file could not be determined dynamically. " +
|
String.format("No tribble type was provided on the command line and the type of the file could not be determined dynamically. " +
|
||||||
|
|
|
||||||
|
|
@ -111,6 +111,10 @@ public class UserException extends ReviewedStingException {
|
||||||
super(String.format("Couldn't read file because %s caused by %s", message, e.getMessage()));
|
super(String.format("Couldn't read file because %s caused by %s", message, e.getMessage()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CouldNotReadInputFile(File file) {
|
||||||
|
super(String.format("Couldn't read file %s", file.getAbsolutePath()));
|
||||||
|
}
|
||||||
|
|
||||||
public CouldNotReadInputFile(File file, String message) {
|
public CouldNotReadInputFile(File file, String message) {
|
||||||
super(String.format("Couldn't read file %s because %s", file.getAbsolutePath(), message));
|
super(String.format("Couldn't read file %s because %s", file.getAbsolutePath(), message));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue