From 21f5867c2fed8d7acdaf57b669d5eb9bf446fde4 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 | 2 -- scylla-proxy/src/errors.rs | 4 ++-- scylla-proxy/src/proxy.rs | 2 -- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/scylla-cql/src/frame/frame_errors.rs b/scylla-cql/src/frame/frame_errors.rs index d592c5d6b7..221896974d 100644 --- a/scylla-cql/src/frame/frame_errors.rs +++ b/scylla-cql/src/frame/frame_errors.rs @@ -62,8 +62,6 @@ pub enum FrameSerializationError { #[derive(Error, Debug)] pub enum ParseError { - #[error("Low-level deserialization failed: {0}")] - LowLevelDeserializationError(#[from] LowLevelDeserializationError), #[error(transparent)] TryFromIntError(#[from] std::num::TryFromIntError), } diff --git a/scylla-proxy/src/errors.rs b/scylla-proxy/src/errors.rs index 163aa62913..bf0ed038fa 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::{FrameDeserializationError, ParseError}; +use scylla_cql::frame::frame_errors::{FrameDeserializationError, 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(FrameDeserializationError), #[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 5446026c12..7f9cef1994 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; @@ -804,7 +803,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)