Need to catch RuntimeExceptions coming out of Picard too so that they show up as UserErrors (some BAM errors are thrown as REs).
This commit is contained in:
parent
d0056d6c71
commit
ab1c48745b
|
|
@ -6,6 +6,7 @@ import net.sf.samtools.util.CloseableIterator;
|
||||||
import org.broadinstitute.sting.utils.exceptions.UserException;
|
import org.broadinstitute.sting.utils.exceptions.UserException;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -23,7 +24,7 @@ public class MalformedBAMErrorReformatingIterator implements CloseableIterator<S
|
||||||
public boolean hasNext() {
|
public boolean hasNext() {
|
||||||
try {
|
try {
|
||||||
return this.it.hasNext();
|
return this.it.hasNext();
|
||||||
} catch ( SAMFormatException e ) {
|
} catch ( RuntimeException e ) { // we need to catch RuntimeExceptions here because the Picard code is throwing them (among SAMFileExceptions) sometimes
|
||||||
throw new UserException.MalformedBAM(source, e.getMessage());
|
throw new UserException.MalformedBAM(source, e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -31,7 +32,7 @@ public class MalformedBAMErrorReformatingIterator implements CloseableIterator<S
|
||||||
public SAMRecord next() {
|
public SAMRecord next() {
|
||||||
try {
|
try {
|
||||||
return it.next();
|
return it.next();
|
||||||
} catch ( SAMFormatException e ) {
|
} catch ( RuntimeException e ) { // we need to catch RuntimeExceptions here because the Picard code is throwing them (among SAMFileExceptions) sometimes
|
||||||
throw new UserException.MalformedBAM(source, e.getMessage());
|
throw new UserException.MalformedBAM(source, e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue