Add category for error messages - #300
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces an ErrorLevel enum (ERROR, WARN, INFO) to classify annotation errors and updates the error report format to include this level. It also adds handling for variants spanning coding/UTR boundaries, classifying them as expected INFO-level events, and improves error details for unknown annotations. The feedback suggests using StringUtils.isNotBlank to handle empty or whitespace-only error messages more robustly, and removing a redundant null check for the variant classification string.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| String errorDetail = annotatedRecord.getErrorMessage() != null | ||
| ? annotatedRecord.getErrorMessage() | ||
| : "no error details available - check genome nexus logs"; |
There was a problem hiding this comment.
If annotatedRecord.getErrorMessage() returns an empty string or whitespace, the resulting error message will be formatted as UNKNOWN_ANNOTATION_ERROR_MESSAGE + ";" + "", which is not very helpful. Using StringUtils.isNotBlank (from org.apache.commons.lang.StringUtils, which is already imported) ensures that we fall back to the default message if the error message is empty or blank.
| String errorDetail = annotatedRecord.getErrorMessage() != null | |
| ? annotatedRecord.getErrorMessage() | |
| : "no error details available - check genome nexus logs"; | |
| String errorDetail = StringUtils.isNotBlank(annotatedRecord.getErrorMessage()) | |
| ? annotatedRecord.getErrorMessage() | |
| : "no error details available - check genome nexus logs"; |
| private boolean isVariantSpanningNonCodingRegion(AnnotatedRecord annotatedRecord) { | ||
| String varClass = annotatedRecord.getVARIANT_CLASSIFICATION(); | ||
| if (varClass == null) return false; | ||
| return varClass.contains("Frame_Shift") || varClass.contains("In_Frame"); | ||
| } |
There was a problem hiding this comment.
The null check if (varClass == null) is redundant because getVARIANT_CLASSIFICATION() is guaranteed to return an empty string "" instead of null (as implemented in MutationRecord.java). We can simplify this method by removing the redundant null check.
private boolean isVariantSpanningNonCodingRegion(AnnotatedRecord annotatedRecord) {
String varClass = annotatedRecord.getVARIANT_CLASSIFICATION();
return varClass.contains("Frame_Shift") || varClass.contains("In_Frame");
}1. update gn java client model 2. update tests to ignore first line #genome_nexus_version: x.x.x
…lice mutation' catogory
No description provided.