Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
conn: map sub-error type to UserRequestError
Ultimately, we want to get rid of From<RequestError> for QueryError implementation. This is because, RequestError contains a CqlResponseParseError which is overloaded with variants such as CqlAuthChallengeParseError which should not be returned to the user who uses only BATCH, QUERY, EXECUTE and PREPARE requests. This is why, we make two transitions in error types in this place. The first transition is RequestError -> UserRequestError (map_err()), which filters out variants such as CqlAuthChallengeParseError, and leaves only either CqlErrorParseError or CqlResultParseError. The second transition (? operator) is UserRequestError -> QueryError which makes use of From<UserRequestError> for QueryError implementation.
- Loading branch information