Skip to content

Commit

Permalink
f_errors: remove LLDeserError from ParseError
Browse files Browse the repository at this point in the history
Removed last usages of ParseError from scylla-proxy.
This allows us to remove LowLevelDeserializationError variant from ParseError.
  • Loading branch information
muzarski committed Sep 25, 2024
1 parent f7585f6 commit 2ea9b45
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
5 changes: 1 addition & 4 deletions scylla-cql/src/frame/frame_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions scylla-proxy/src/errors.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand All @@ -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}")]
Expand Down
2 changes: 0 additions & 2 deletions scylla-proxy/src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 2ea9b45

Please sign in to comment.