Catch samtools exceptions and make them 'BAM Exceptions' asking the user to run Picard's validator and re-index the file before posting anything to the forum. Let's see whether this helps or not.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5658 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
e97a5ca161
commit
673772a522
|
|
@ -385,6 +385,25 @@ public abstract class CommandLineProgram {
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void exitSystemWithSamError(final Exception e) {
|
||||||
|
if ( e.getMessage() == null )
|
||||||
|
throw new ReviewedStingException("SamException found with no message!", e);
|
||||||
|
|
||||||
|
errorPrintf("------------------------------------------------------------------------------------------%n");
|
||||||
|
errorPrintf("A BAM ERROR has occurred (version %s): %n", CommandLineGATK.getVersionNumber());
|
||||||
|
errorPrintf("The invalid inputs must be corrected before the GATK can proceed%n");
|
||||||
|
errorPrintf("Please do not post this error to the GATK forum until you have followed the instructions below%n");
|
||||||
|
errorPrintf("%n");
|
||||||
|
errorPrintf("Please make sure that your BAM file is well-formed by running Picard's validator on it%n");
|
||||||
|
errorPrintf("(see http://picard.sourceforge.net/command-line-overview.shtml#ValidateSamFile for details)%n");
|
||||||
|
errorPrintf("Also, please ensure that your BAM index is not corrupted: delete the current one and regenerate it with 'samtools index'%n");
|
||||||
|
printDocumentationReference();
|
||||||
|
errorPrintf("%n");
|
||||||
|
errorPrintf("MESSAGE: %s%n", e.getMessage().trim());
|
||||||
|
errorPrintf("------------------------------------------------------------------------------------------%n");
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* used to indicate an error occured
|
* used to indicate an error occured
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,9 @@ public class CommandLineGATK extends CommandLineExecutable {
|
||||||
// We can generate Tribble Exceptions in weird places when e.g. VCF genotype fields are
|
// We can generate Tribble Exceptions in weird places when e.g. VCF genotype fields are
|
||||||
// lazy loaded, so they aren't caught elsewhere and made into User Exceptions
|
// lazy loaded, so they aren't caught elsewhere and made into User Exceptions
|
||||||
exitSystemWithUserError(e);
|
exitSystemWithUserError(e);
|
||||||
|
} catch (net.sf.samtools.SAMException e) {
|
||||||
|
// Let's try this out and see how it is received by our users
|
||||||
|
exitSystemWithSamError(e);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
exitSystemWithError(e);
|
exitSystemWithError(e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue