convert Runtime exceptions in the CRAM code into CRAMExceptions (also…#1526
Open
yfarjoun wants to merge 1 commit into
Open
convert Runtime exceptions in the CRAM code into CRAMExceptions (also…#1526yfarjoun wants to merge 1 commit into
yfarjoun wants to merge 1 commit into
Conversation
cmnbroad
reviewed
Jan 11, 2021
| referenceBases = referenceSource.getReferenceBases(sequence, true); | ||
| if (referenceBases == null) { | ||
| throw new IllegalArgumentException( | ||
| throw new CRAMException( |
Contributor
There was a problem hiding this comment.
I'm not sure what the original intent of CRAMException was, but starting with the CRAM rewrite I restricted it's use to internal error conditions, such as malformed input as reported in broadinstitute/picard#1624. Not all of the CRAM codebase is conforming yet, but I don't think this is a case where CRAMException makes sense, since this is a user error.
| return details; | ||
| default: | ||
| throw new IllegalArgumentException("Unknown tag type: " + (char) type); | ||
| throw new CRAMException("Unknown tag type: " + (char) type); |
Contributor
There was a problem hiding this comment.
This one does seem like an appropriate case for CRAMException.
| } | ||
|
|
||
| throw new IllegalArgumentException(String.format("Unrecognized CRAM version %s", cramVersion)); | ||
| throw new CRAMException(String.format("Unrecognized CRAM version %s", cramVersion)); |
Contributor
There was a problem hiding this comment.
This one is borderline, but I'd err on leaving it as IllegalArgumentException, or else RuntimeException.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… runtime)
(sorry again about the push to master)
Description
Please explain the changes you made here.
Explain the motivation for making this change. What existing problem does the pull request solve?
Things to think about before submitting: