From 2ea9b45f3deddeb2876fefc5c992eb89b3686315 Mon Sep 17 00:00:00 2001 From: muzarski Date: Wed, 7 Aug 2024 11:17:34 +0200 Subject: [PATCH] f_errors: remove LLDeserError from ParseError Removed last usages of ParseError from scylla-proxy. This allows us to remove LowLevelDeserializationError variant from ParseError. --- scylla-cql/src/frame/frame_errors.rs | 5 +---- scylla-proxy/src/errors.rs | 4 ++-- scylla-proxy/src/proxy.rs | 2 -- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/scylla-cql/src/frame/frame_errors.rs b/scylla-cql/src/frame/frame_errors.rs index 4c8fd4644..30483eac3 100644 --- a/scylla-cql/src/frame/frame_errors.rs +++ b/scylla-cql/src/frame/frame_errors.rs @@ -90,10 +90,7 @@ pub enum FrameHeaderParseError { } #[derive(Error, Debug)] -pub enum ParseError { - #[error("Low-level deserialization failed: {0}")] - LowLevelDeserializationError(#[from] LowLevelDeserializationError), -} +pub enum ParseError {} /// An error that occurred during CQL request serialization. #[non_exhaustive] diff --git a/scylla-proxy/src/errors.rs b/scylla-proxy/src/errors.rs index ff75f3f60..fa1cc47d8 100644 --- a/scylla-proxy/src/errors.rs +++ b/scylla-proxy/src/errors.rs @@ -1,6 +1,6 @@ use std::net::SocketAddr; -use scylla_cql::frame::frame_errors::{FrameHeaderParseError, ParseError}; +use scylla_cql::frame::frame_errors::{FrameHeaderParseError, LowLevelDeserializationError}; use thiserror::Error; #[derive(Debug, Error)] @@ -22,7 +22,7 @@ pub enum DoorkeeperError { #[error("Could not send read Supported frame for obtaining shards number: {0}")] ObtainingShardNumberFrame(FrameHeaderParseError), #[error("Could not read Supported options: {0}")] - ObtainingShardNumberParseOptions(ParseError), + ObtainingShardNumberParseOptions(LowLevelDeserializationError), #[error("ShardInfo parameters missing")] ObtainingShardNumberNoShardInfo, #[error("Could not parse shard number: {0}")] diff --git a/scylla-proxy/src/proxy.rs b/scylla-proxy/src/proxy.rs index 4b4e7672c..6c5b5e62f 100644 --- a/scylla-proxy/src/proxy.rs +++ b/scylla-proxy/src/proxy.rs @@ -5,7 +5,6 @@ use crate::frame::{ }; use crate::{RequestOpcode, TargetShard}; use bytes::Bytes; -use scylla_cql::frame::frame_errors::ParseError; use scylla_cql::frame::types::read_string_multimap; use std::collections::HashMap; use std::fmt::Display; @@ -806,7 +805,6 @@ impl Doorkeeper { .map_err(DoorkeeperError::ObtainingShardNumberFrame)?; let options = read_string_multimap(&mut supported_frame.body.as_ref()) - .map_err(ParseError::from) .map_err(DoorkeeperError::ObtainingShardNumberParseOptions)?; Ok(options)