Skip to content

Conversation

@tatu-at-datastax
Copy link
Contributor

What this PR does:

Converts more ErrorCodeV1 entries into V2 typed exceptions

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 7, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

📉 Unit Test Coverage Delta vs Main Branch

Metric Value
Main Branch 50.59%
This PR 50.58%
Delta 🔴 -0.01%
⚠️ Coverage decreased

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

Unit Test Coverage Report

Overall Project 50.58% -0.05% 🍏
Files changed 52.83%

File Coverage
SchemaException.java 100% 🍏
DatabaseException.java 100% 🍏
DocumentException.java 100% 🍏
JsonApiException.java 95.69% 🍏
ErrorCodeV1.java 93.93% 🍏
CreateCollectionOperation.java 67.89% -0.83%
CollectionSchemaObject.java 29.11% -4.07%
ThrowableToErrorMapper.java 25.94% -2.46%

// Support for converting legacy ErrorCodeV1 usage
// Copied from JsonApiException with modifications
@Override
public CommandResult get() {
Copy link
Contributor Author

@tatu-at-datastax tatu-at-datastax Jan 7, 2026

Choose a reason for hiding this comment

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

Needed because of the way Mutiny pipeline is defined in CreateCollectionOperation (and probably in other places); instead of exception type, Supplier<CommandResult> is expected.

Copy link
Contributor

Choose a reason for hiding this comment

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

-1 on this, lets discuss

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will revert, as discussed.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

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

Metric Value
Main Branch 70.59%
This PR 70.73%
Delta 🟢 +0.14%
✅ Coverage improved!

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

Integration Test Coverage Report (dse69-it)

Overall Project 70.73% -0.03% 🍏
Files changed 69.81% 🍏

File Coverage
SchemaException.java 100% 🍏
DatabaseException.java 100% 🍏
DocumentException.java 100% 🍏
ErrorCodeV1.java 93.93% 🍏
JsonApiException.java 91% 🍏
CreateCollectionOperation.java 74.4% -0.64%
CollectionSchemaObject.java 69.95% -2.97%
ThrowableToErrorMapper.java 57.14% -0.99% 🍏

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

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

Metric Value
Main Branch 72.38%
This PR 72.53%
Delta 🟢 +0.14%
✅ Coverage improved!

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

Integration Test Coverage Report (hcd-it)

Overall Project 72.53% -0.03% 🍏
Files changed 69.81% 🍏

File Coverage
SchemaException.java 100% 🍏
DatabaseException.java 100% 🍏
DocumentException.java 100% 🍏
ErrorCodeV1.java 93.93% 🍏
JsonApiException.java 91% 🍏
CreateCollectionOperation.java 84.77% -0.64%
CollectionSchemaObject.java 75.12% -2.97%
ThrowableToErrorMapper.java 60.76% -0.99% 🍏

@tatu-at-datastax tatu-at-datastax changed the title (WIP) Batch #13 of ErrorCodeV1 removal (see #2285) Batch #13 of ErrorCodeV1 removal (see #2285) Jan 8, 2026
@tatu-at-datastax tatu-at-datastax marked this pull request as ready for review January 8, 2026 00:53
@tatu-at-datastax tatu-at-datastax requested a review from a team as a code owner January 8, 2026 00:53

// CreateCollection error codes:

EMBEDDING_SERVICE_NOT_CONFIGURED(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved next to related codes; to be converted in follow-up PR.

Underlying problem: ${errorMessage}
Report the problem to database administrators.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These were moved to alphabetic position, not changed in any way.

${SNIPPET.RETRY}
- scope: DATABASE
code: INVALID_COLLECTION_QUERY
Copy link
Contributor Author

@tatu-at-datastax tatu-at-datastax Jan 8, 2026

Choose a reason for hiding this comment

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

Renamed from INVALID_QUERY, but usage should probably be eventually unified with INVALID_DATABASE_QUERY as part of query handling changes.

// CreateCollection error codes:

EXISTING_TABLE_NOT_DATA_API_COLLECTION("Existing table is not a valid Data API collection"),
COLLECTION_CREATION_ERROR(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cannot yet convert this one due to the way it is returned (not throw) in CreateCollectionOperation, handle after @amorton's refactoring of DB access.

CANNOT_RENAME_UNKNOWN_TYPE_FIELD,
CANNOT_VECTORIZE_NON_VECTOR_COLUMNS,
CANNOT_VECTORIZE_UNKNOWN_COLUMNS,
COLLECTION_EXISTS_WITH_DIFFERENT_SETTINGS, // converted from ErrorCodeV1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

renaming undone: changed back to EXISTING_COLLECTION_DIFFERENT_SETTINGS for compatibility reasons.

- scope: SCHEMA
code: COLLECTION_NOT_EXIST
title: Collection already exists with different settings
title: Collection or table does not exist
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed an earlier copy-paste problem.

@tatu-at-datastax tatu-at-datastax force-pushed the tatu/2285-errorv1-removal-13 branch from 0d13d9a to e7bfeba Compare January 9, 2026 19:11
…emoval-13' into tatu/2285-errorv1-removal-13
@tatu-at-datastax tatu-at-datastax merged commit bbb654a into main Jan 9, 2026
3 checks passed
@tatu-at-datastax tatu-at-datastax deleted the tatu/2285-errorv1-removal-13 branch January 9, 2026 20:29
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