Fix for RefSeqCodec bug and better error messages
-- RefSeqCodec bug: getFeatureClass() returned RefSeqCodec.class, not RefSeqFeature.class. Really should change this in Tribble to require Class<T extends Feature> to get compile time type checking -- Better error messages that actually list the available tribble types, when there's a type error
This commit is contained in:
parent
53006da9a5
commit
d59e6ed274
|
|
@ -373,16 +373,16 @@ class RodBindingArgumentTypeDescriptor extends ArgumentTypeDescriptor {
|
|||
if ( featureDescriptor != null ) {
|
||||
tribbleType = featureDescriptor.getName();
|
||||
logger.warn("Dynamically determined type of " + file + " to be " + tribbleType);
|
||||
} else {
|
||||
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. " +
|
||||
"Please add an explicit type tag :TYPE listing the correct type from among the supported types: %s",
|
||||
manager.userFriendlyListOfAvailableFeatures()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( tribbleType == null ) // error handling
|
||||
throw new UserException.CommandLineException(
|
||||
String.format("Could not parse argument %s with value %s",
|
||||
defaultDefinition.fullName, value));
|
||||
|
||||
Constructor ctor = (makeRawTypeIfNecessary(type)).getConstructor(Class.class, String.class, String.class, String.class, Tags.class);
|
||||
Class parameterType = getParameterizedTypeClass(type);
|
||||
RodBinding result = (RodBinding)ctor.newInstance(parameterType, name, value, tribbleType, tags);
|
||||
|
|
@ -395,8 +395,8 @@ class RodBindingArgumentTypeDescriptor extends ArgumentTypeDescriptor {
|
|||
value, source.field.getName()));
|
||||
} catch (Exception e) {
|
||||
throw new UserException.CommandLineException(
|
||||
String.format("Failed to parse value %s for argument %s.",
|
||||
value, source.field.getName()));
|
||||
String.format("Failed to parse value %s for argument %s. Message: %s",
|
||||
value, source.field.getName(), e.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -105,6 +105,6 @@ public class RefSeqCodec implements ReferenceDependentFeatureCodec<RefSeqFeature
|
|||
|
||||
@Override
|
||||
public Class getFeatureType() {
|
||||
return RefSeqCodec.class;
|
||||
return RefSeqFeature.class;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -160,8 +160,8 @@ public class ListFileUtils {
|
|||
rodBinding.getName(), rodBinding.getTribbleType(), builderForValidation.userFriendlyListOfAvailableFeatures()));
|
||||
if ( ! rodBinding.getType().isAssignableFrom(descriptor.getFeatureClass()) )
|
||||
throw new UserException.BadArgumentValue(rodBinding.getName(),
|
||||
String.format("Field %s expected type %s, but the type of the input file provided on the command line was %s. Please make sure that you have provided the correct file type and/or that you are not binding your rod to a name matching one of the available types.",
|
||||
rodBinding.getName(), rodBinding.getType(), descriptor.getName()));
|
||||
String.format("Field %s expected type %s, but the type of the input file provided on the command line was %s producing %s. Please make sure that you have provided the correct file type and/or that you are not binding your rod to a name matching one of the available types.",
|
||||
rodBinding.getName(), rodBinding.getType(), descriptor.getName(), descriptor.getFeatureClass()));
|
||||
|
||||
|
||||
rodBindings.add(triplet);
|
||||
|
|
|
|||
Loading…
Reference in New Issue