Skip to content

Conversation

@yfarjoun
Copy link
Contributor

… 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:

  • Make sure your changes compile and new tests pass locally.
  • Add new tests or update existing ones:
    • A bug fix should include a test that previously would have failed and passes now.
    • New features should come with new tests that exercise and validate the new functionality.
  • Extended the README / documentation, if necessary
  • Check your code style.
  • Write a clear commit title and message
    • The commit message should describe what changed and is targeted at htsjdk developers
    • Breaking changes should be mentioned in the commit message.

@yfarjoun yfarjoun requested a review from cmnbroad December 23, 2020 20:53
Copy link
Collaborator

@cmnbroad cmnbroad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yfarjoun Most of these seem good; except for a couple. If you don't have time to finish this just let me know and I'll take it over.

referenceBases = referenceSource.getReferenceBases(sequence, true);
if (referenceBases == null) {
throw new IllegalArgumentException(
throw new CRAMException(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is borderline, but I'd err on leaving it as IllegalArgumentException, or else RuntimeException.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants