Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(incremental) Catch and re-throw Java CQL Driver fail exceptions as JsonApiException #851

Merged
merged 16 commits into from
Feb 14, 2024

Conversation

Yuqi-Du
Copy link
Contributor

@Yuqi-Du Yuqi-Du commented Feb 1, 2024

authentication failure from driver -> JsonApiException UNAUTHORIZED_REQUEST, 401
invalid query (e.g. vector dimension mismatch) -> JsonApiException INVALID_QUERY, 200
DriverTimeout, WriteTimeout, ReadTimeout -> JsonApiException OPERATION_TIMEOUT, 200

What this PR does:
partially fix #751

This PR should be actively discussed, since driver exception like NoNodeAvailableException, is tricky to locate and map into JsonApiException

Checklist

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

@Yuqi-Du Yuqi-Du requested a review from a team as a code owner February 1, 2024 02:21
@Yuqi-Du
Copy link
Contributor Author

Yuqi-Du commented Feb 1, 2024

Exception Commands
DriverTimeoutException CreateCollectionCommand
AllNodesFailedException CreateCollectionCommand
FindCollectionsCommand
FindNamespacesCommand
NoNodeAvailableException DeleteCollectionCommand
FindOneCommand
InsertManyCommand
CreateCollectionCommand
FindCommand
InvalidQueryException CountDocumentsCommand
CreateCollectionCommand
DeleteCollectionCommand
FindCommand
InsertManyCommand
InsertOneCommand
ClosedConnectionException CountDocumentsCommand
CreateCollectionCommand
DeleteCollectionCommand
FindCommand
ReadFailureException CountDocumentsCommand
FindCommand
UnauthorizedException CreateCollectionCommand
ServerError CreateCollectionCommand

Copy link
Contributor

@jeffreyscarpenter jeffreyscarpenter left a comment

Choose a reason for hiding this comment

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

I think we should discuss what makes sense to expose as its own error code. Seems to me we are getting too fine grained in the error codes with implementation-specific cases.

@Yuqi-Du Yuqi-Du merged commit 42960ac into main Feb 14, 2024
2 checks passed
@Yuqi-Du Yuqi-Du deleted the rethrow-jsonexception branch February 14, 2024 19:36
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.

Catch and re-throw Java CQL Driver fail exceptions as JsonApiException with appropriate errorCodes
3 participants