From 0b07edf3732a0786e04d2cc203b6e66f159fbeb7 Mon Sep 17 00:00:00 2001 From: joonkang-git <122251818+joonkang-git@users.noreply.github.com> Date: Sat, 10 Aug 2024 02:52:40 +0000 Subject: [PATCH] [Adam - 2401] Refactoring Error Messages --- .../main/scala/org/bdgenomics/adam/models/MdTag.scala | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/adam-core/src/main/scala/org/bdgenomics/adam/models/MdTag.scala b/adam-core/src/main/scala/org/bdgenomics/adam/models/MdTag.scala index 0d263b78c8..f6211fda81 100644 --- a/adam-core/src/main/scala/org/bdgenomics/adam/models/MdTag.scala +++ b/adam-core/src/main/scala/org/bdgenomics/adam/models/MdTag.scala @@ -176,6 +176,9 @@ object MdTag { case (CigarOperator.INSERTION | CigarOperator.H | CigarOperator.S | CigarOperator.P, _) => cigarIdx += 1 + + case _ => + throw new UnsupportedOperationException(s"Unsupported CigarOperator: ${cigarElement.getOperator}") } } new MdTag(referenceStart, matches, mismatches, deletions) @@ -245,7 +248,7 @@ object MdTag { readPos += cigarElement.getLength } if (cigarElement.getOperator.consumesReferenceBases) { - throw new IllegalArgumentException("Cannot handle operator: " + cigarElement.getOperator) + throw new UnsupportedOperationException("Cannot handle operator: " + cigarElement.getOperator) } } } @@ -339,7 +342,7 @@ object MdTag { readPos += cigarElement.getLength } if (cigarElement.getOperator.consumesReferenceBases) { - throw new IllegalArgumentException("Cannot handle operator: " + cigarElement.getOperator) + throw new UnsupportedOperationException("Cannot handle operator: " + cigarElement.getOperator) } } } @@ -511,7 +514,7 @@ case class MdTag( readPos += insLength } if (cigarElement.getOperator.consumesReferenceBases) { - throw new IllegalArgumentException("Cannot handle operator: " + cigarElement.getOperator) + throw new UnsupportedOperationException("Cannot handle operator: " + cigarElement.getOperator) } } }