Skip to content

Add category for error messages - #300

Open
leexgh wants to merge 5 commits into
genome-nexus:masterfrom
leexgh:message-improve
Open

Add category for error messages#300
leexgh wants to merge 5 commits into
genome-nexus:masterfrom
leexgh:message-improve

Conversation

@leexgh

@leexgh leexgh commented Jun 22, 2026

Copy link
Copy Markdown
Member

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment on lines +171 to +173
String errorDetail = annotatedRecord.getErrorMessage() != null
? annotatedRecord.getErrorMessage()
: "no error details available - check genome nexus logs";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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.

Suggested change
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";

Comment on lines +195 to +199
private boolean isVariantSpanningNonCodingRegion(AnnotatedRecord annotatedRecord) {
String varClass = annotatedRecord.getVARIANT_CLASSIFICATION();
if (varClass == null) return false;
return varClass.contains("Frame_Shift") || varClass.contains("In_Frame");
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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");
    }

leexgh added 4 commits June 22, 2026 19:27
1. update gn java client model
2. update tests to ignore first line #genome_nexus_version: x.x.x
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.

1 participant