Skip to content

Clean up exception hierarchy#1605

Merged
JPercival merged 1 commit intomasterfrom
feature-exception-cleanup
Sep 24, 2025
Merged

Clean up exception hierarchy#1605
JPercival merged 1 commit intomasterfrom
feature-exception-cleanup

Conversation

@JPercival
Copy link
Copy Markdown
Contributor

  • Makes a CqlIncludeException a type of CqlCompilerException
  • Reduces unused overloads of CqlCompilerExceptions
  • Use only one list to track all exception types (as opposed to 4)
  • Next steps
    • Compiler: Make locator non-nullable, ensure we have context to provide a locator everywhere an exception is thrown
    • Engine: Support returning multiple compiler exceptions, instead of flattening them all into one message

@github-actions
Copy link
Copy Markdown

Formatting check succeeded!

@antvaset antvaset changed the base branch from feature-kotlin to master September 24, 2025 20:15
@JPercival JPercival force-pushed the feature-exception-cleanup branch from 86de4e7 to b244e0c Compare September 24, 2025 20:20
@codecov
Copy link
Copy Markdown

codecov bot commented Sep 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.88%. Comparing base (43fed87) to head (b244e0c).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1605   +/-   ##
=========================================
  Coverage     62.88%   62.88%           
  Complexity     1863     1863           
=========================================
  Files           341      341           
  Lines         14925    14925           
  Branches       2966     2966           
=========================================
  Hits           9385     9385           
  Misses         4060     4060           
  Partials       1480     1480           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@JPercival JPercival merged commit 928da1d into master Sep 24, 2025
8 of 9 checks passed
@JPercival JPercival deleted the feature-exception-cleanup branch September 24, 2025 22:01
@cmoesel
Copy link
Copy Markdown
Member

cmoesel commented Sep 25, 2025

@JPercival - One of our CQL Translations Service tests just started failing with this change. It is a test for properly returning an error when an included library is missing.

Whereas a missing library used to result in this annotation:

{
  "type": "CqlToElmError",
  "libraryId": "CMS146",
  "libraryVersion": "2",
  "startLine": 5,
  "startChar": 1,
  "endLine": 5,
  "endChar": 37,
  "message": "Could not load source for library CMSAll, version 1, namespace uri null.",
  "errorType": "include",
  "errorSeverity": "error",
  "targetIncludeLibraryId": "CMSAll",
  "targetIncludeLibraryVersionId": "1"
}

It now results in this annotation:

{
  "type": "CqlToElmError",
  "libraryId": "CMS146",
  "libraryVersion": "2",
  "startLine": 5,
  "startChar": 1,
  "endLine": 5,
  "endChar": 37,
  "message": "Could not load source for library CMSAll, version 1, namespace uri null.",
  "errorType": "internal",
  "errorSeverity": "error"
}

Note that:

  • errorType changes from include to internal
  • targetIncludeLibraryId is no longer provided
  • targetIncludeLibraryVersionId is no longer provided

I see that CqlIncludeException still exists as a specific exception in the Java code, but it seems all its specificity is now removed in the serialization to an annotation. Is that intentional (for example, as part of an effort to normalize annotations to just a few types and common schemas)?

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.

4 participants