Skip to content

Conversation

@tatu-at-datastax
Copy link
Contributor

What this PR does:

Converts yet more ErrorCodeV1 entries to new Error entities

Which issue(s) this PR fixes:
Part of #2285

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

@tatu-at-datastax tatu-at-datastax self-assigned this Jan 2, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 2, 2026

📈 Unit Test Coverage Delta vs Main Branch

Metric Value
Main Branch 50.59%
This PR 50.59%
Delta 🟢 +0.00%
✅ Coverage improved!

@github-actions
Copy link
Contributor

github-actions bot commented Jan 2, 2026

Unit Test Coverage Report

Overall Project 50.59% -0.2% 🍏
Files changed 72.48% 🍏

File Coverage
DatabaseException.java 100% 🍏
DocumentException.java 100% 🍏
JsonApiException.java 95.79% 🍏
ErrorCodeV1.java 94.25% 🍏
JsonUtil.java 86.99% -0.39% 🍏
DocumentId.java 78.41% -5% 🍏
CollectionReadOperation.java 73.6% -0.77%
EmbeddingProvidersConfig.java 72.73% -4.96%
WritableShreddedDocument.java 70.58% -3.87%
DocumentShredder.java 65.98% -10.97% 🍏
ThrowableToErrorMapper.java 26.03% -0.82%
WebApplicationExceptionMapper.java 0% -8.14%

@github-actions
Copy link
Contributor

github-actions bot commented Jan 2, 2026

📉 Integration Test Coverage Delta vs Main Branch (hcd-it)

Metric Value
Main Branch 72.46%
This PR 72.38%
Delta 🔴 -0.08%
⚠️ Coverage decreased

@github-actions
Copy link
Contributor

github-actions bot commented Jan 2, 2026

Integration Test Coverage Report (hcd-it)

Overall Project 72.38% -0.3% 🍏
Files changed 59.87%

File Coverage
DocumentException.java 100% 🍏
ErrorCodeV1.java 94.25% 🍏
JsonApiException.java 91.2% 🍏
WebApplicationExceptionMapper.java 90.7% 🍏
JsonUtil.java 86.6% -4.08% 🍏
DocumentShredder.java 85.64% -8.63% 🍏
CollectionReadOperation.java 80.18% -0.77%
EmbeddingProvidersConfig.java 78.51% -4.96%
WritableShreddedDocument.java 66.85% -6.35%
ThrowableToErrorMapper.java 60.46% 🍏
DocumentId.java 60.45% -24.09%
DatabaseException.java 0% -9.38%

@github-actions
Copy link
Contributor

github-actions bot commented Jan 2, 2026

📉 Integration Test Coverage Delta vs Main Branch (dse69-it)

Metric Value
Main Branch 70.67%
This PR 70.59%
Delta 🔴 -0.08%
⚠️ Coverage decreased

@github-actions
Copy link
Contributor

github-actions bot commented Jan 2, 2026

Integration Test Coverage Report (dse69-it)

Overall Project 70.59% -0.3% 🍏
Files changed 59.19%

File Coverage
DocumentException.java 100% 🍏
ErrorCodeV1.java 94.25% 🍏
JsonApiException.java 91.2% 🍏
WebApplicationExceptionMapper.java 90.7% 🍏
JsonUtil.java 86.6% -4.08% 🍏
DocumentShredder.java 83.33% -8.63% 🍏
CollectionReadOperation.java 80.18% -0.77%
EmbeddingProvidersConfig.java 78.51% -4.96%
WritableShreddedDocument.java 65.88% -6.35%
DocumentId.java 60.45% -24.09%
ThrowableToErrorMapper.java 56.84% -0.82%
DatabaseException.java 0% -9.38%

return OPTIONS;
}
throw ErrorCodeV1.INVALID_PARAMETER_VALIDATION_TYPE.toApiException(type);
throw new IllegalArgumentException(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

One-off failure not to be directly exposed: caller will wrap/convert validation problems in more centralized way.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am guessing we only need this stuff because of the EGW and the trouble we have with configs ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure why this was added: I don't think non-contextual, Enum lookups should throw Data API exceptions; they can't add much context information. I'll see what caller does.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Uh. It's called from just one place but that's a Record constructor in ParameterConfigImpl:

      public ParameterConfigImpl(
          EmbeddingGateway.GetSupportedProvidersResponse.ProviderConfig.ParameterConfig
              grpcModelParameter) {
        this(
            grpcModelParameter.getName(),
            ParameterType.valueOf(grpcModelParameter.getType().name()),
            grpcModelParameter.getRequired(),
            Optional.of(grpcModelParameter.getDefaultValue()),
            grpcModelParameter.getValidationMap().entrySet().stream()
                .collect(
                    Collectors.toMap(
                        e -> ValidationType.fromString(e.getKey()),
                        e -> new ArrayList<>(e.getValue().getValuesList()))),

will leave as-is, for now.

@tatu-at-datastax tatu-at-datastax marked this pull request as ready for review January 3, 2026 01:32
@tatu-at-datastax tatu-at-datastax requested a review from a team as a code owner January 3, 2026 01:32
@tatu-at-datastax tatu-at-datastax changed the title Batch 12 of #2285, converting ErrorCodeV1 entries Batch 12 of #2285, converting shredding-related ErrorCodeV1 entries Jan 5, 2026
Copy link
Contributor

@amorton amorton left a comment

Choose a reason for hiding this comment

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

some nit picks, and we should pull out some things for me to polish after the merge. see comments.

Biggest questions are in DocumentId where it is decoding from DB

INVALID_COLUMN_VALUES,
MISSING_PRIMARY_KEY_COLUMNS,

SHRED_BAD_BINARY_VECTOR_VALUE,
Copy link
Contributor

Choose a reason for hiding this comment

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

we dont have any BAD error codes in V2 errors - we can let them through and then I can fix in a follow up ? as in they take some thinking do we want to do that now ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, postpone for now to give us more time to think it through.

return OPTIONS;
}
throw ErrorCodeV1.INVALID_PARAMETER_VALIDATION_TYPE.toApiException(type);
throw new IllegalArgumentException(
Copy link
Contributor

Choose a reason for hiding this comment

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

I am guessing we only need this stuff because of the EGW and the trouble we have with configs ?

Document field name not valid: ${errorMessage}.
- scope: DOCUMENT
code: SHRED_BAD_VECTOR_SIZE
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this is a copy of the old error - tagging that it needs work... there will also be places where the array is non zero but not the expected size.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Probably follow-up concern?

@tatu-at-datastax tatu-at-datastax merged commit fe41313 into main Jan 7, 2026
3 checks passed
@tatu-at-datastax tatu-at-datastax deleted the tatu/2285-errorv1-removal-12 branch January 7, 2026 02:11
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.

3 participants