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,15 +373,15 @@ class RodBindingArgumentTypeDescriptor extends ArgumentTypeDescriptor {
|
||||||
if ( featureDescriptor != null ) {
|
if ( featureDescriptor != null ) {
|
||||||
tribbleType = featureDescriptor.getName();
|
tribbleType = featureDescriptor.getName();
|
||||||
logger.warn("Dynamically determined type of " + file + " to be " + tribbleType);
|
logger.warn("Dynamically determined type of " + file + " to be " + tribbleType);
|
||||||
}
|
} else {
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( tribbleType == null ) // error handling
|
|
||||||
throw new UserException.CommandLineException(
|
throw new UserException.CommandLineException(
|
||||||
String.format("Could not parse argument %s with value %s",
|
String.format("No tribble type was provided on the command line and the type of the file could not be determined dynamically. " +
|
||||||
defaultDefinition.fullName, value));
|
"Please add an explicit type tag :TYPE listing the correct type from among the supported types: %s",
|
||||||
|
manager.userFriendlyListOfAvailableFeatures()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Constructor ctor = (makeRawTypeIfNecessary(type)).getConstructor(Class.class, String.class, String.class, String.class, Tags.class);
|
Constructor ctor = (makeRawTypeIfNecessary(type)).getConstructor(Class.class, String.class, String.class, String.class, Tags.class);
|
||||||
Class parameterType = getParameterizedTypeClass(type);
|
Class parameterType = getParameterizedTypeClass(type);
|
||||||
|
|
@ -395,8 +395,8 @@ class RodBindingArgumentTypeDescriptor extends ArgumentTypeDescriptor {
|
||||||
value, source.field.getName()));
|
value, source.field.getName()));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new UserException.CommandLineException(
|
throw new UserException.CommandLineException(
|
||||||
String.format("Failed to parse value %s for argument %s.",
|
String.format("Failed to parse value %s for argument %s. Message: %s",
|
||||||
value, source.field.getName()));
|
value, source.field.getName(), e.getMessage()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,6 @@ public class RefSeqCodec implements ReferenceDependentFeatureCodec<RefSeqFeature
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class getFeatureType() {
|
public Class getFeatureType() {
|
||||||
return RefSeqCodec.class;
|
return RefSeqFeature.class;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -160,8 +160,8 @@ public class ListFileUtils {
|
||||||
rodBinding.getName(), rodBinding.getTribbleType(), builderForValidation.userFriendlyListOfAvailableFeatures()));
|
rodBinding.getName(), rodBinding.getTribbleType(), builderForValidation.userFriendlyListOfAvailableFeatures()));
|
||||||
if ( ! rodBinding.getType().isAssignableFrom(descriptor.getFeatureClass()) )
|
if ( ! rodBinding.getType().isAssignableFrom(descriptor.getFeatureClass()) )
|
||||||
throw new UserException.BadArgumentValue(rodBinding.getName(),
|
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.",
|
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()));
|
rodBinding.getName(), rodBinding.getType(), descriptor.getName(), descriptor.getFeatureClass()));
|
||||||
|
|
||||||
|
|
||||||
rodBindings.add(triplet);
|
rodBindings.add(triplet);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue