From 6d6feb55406d55f14165d6aa295849c4794452b6 Mon Sep 17 00:00:00 2001 From: Mark DePristo Date: Tue, 23 Aug 2011 10:56:37 -0400 Subject: [PATCH] Better error message when you cannot determine a ROD type because the file doesn't exist or cannot be read --- .../sting/commandline/ArgumentTypeDescriptor.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/public/java/src/org/broadinstitute/sting/commandline/ArgumentTypeDescriptor.java b/public/java/src/org/broadinstitute/sting/commandline/ArgumentTypeDescriptor.java index ff992d77d..16358d05f 100644 --- a/public/java/src/org/broadinstitute/sting/commandline/ArgumentTypeDescriptor.java +++ b/public/java/src/org/broadinstitute/sting/commandline/ArgumentTypeDescriptor.java @@ -379,10 +379,14 @@ class RodBindingArgumentTypeDescriptor extends ArgumentTypeDescriptor { } if ( tribbleType == null ) - 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 :NAME listing the correct type from among the supported types:%n%s", - manager.userFriendlyListOfAvailableFeatures(parameterType))); + if ( ! file.canRead() | !! file.isFile() ) { + throw new UserException.BadArgumentValue(name, "Couldn't read file to determine type: " + file); + } 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 :NAME listing the correct type from among the supported types:%n%s", + manager.userFriendlyListOfAvailableFeatures(parameterType))); + } } }