-
Notifications
You must be signed in to change notification settings - Fork 114
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
errors: refactor errors on USE KEYSPACE execution path and clean up NewSessionError #1180
errors: refactor errors on USE KEYSPACE execution path and clean up NewSessionError #1180
Conversation
80b8a51
to
424cb76
Compare
See the following report for details: cargo semver-checks output
|
group 0 test failure... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳 How wonderful to see NewSessionError
finally free of those redundant variants!
424cb76
to
f43a3c1
Compare
Rebased on main |
Note: I wasn't able to split it into multiple commits. It's always tricky to split the changes into multiple commits when there are some tokio channels we use to send a `Result<_, SomeError>` where SomeError is the error type we adjust. Major changes: - UseKeyspaceProtocolError is now renamed to UseKeyspaceError. New variants are introduced. - Removed ProtocolError::UseKeyspace variant - Added UseKeyspaceError variant to QueryError and NewSessionError - Replaced `QueryError` with `UseKeyspacError` in USE KEYSPACE execution path in `Session`, `Cluster`, `ClusterWorker`, `Node`, `PoolRefiller` and `Connection` methods. There is a potential FIXME I introduced. Pay attention to this during review.
It was moved to UseKeyspaceError
It's not used anymore
f43a3c1
to
32f5a21
Compare
v1.1: Adjusted the |
Ref: #519
Motivation
NewSessionError
has a lot of variants that can't even be constructed. This is all because ofFrom<QueryError> for NewSessionError
implementation. The only remaining execution path where we make use of this conversion is USE KEYSPACE request execution. (Previously, there was alsoMetadataReader::read_metadata
that returnedQueryError
, but this was addressed in previous PR).This is why we narrow the return error types in USE KEYSPACE execution path - from
QueryError
to newUseKeyspaceError
.[ ] I added relevant tests for new features and bug fixes.[ ] I have adjusted the documentation in./docs/source/
.Fixes:
annotations to PR description.