Skip to content

Commit f4e70ab

Browse files
committed
errors: reorder ExecutionError variants
So the order resembles the order of variants construction during execution.
1 parent 92820f3 commit f4e70ab

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

scylla/src/errors.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,6 @@ use crate::response::query_result::{IntoRowsResultError, SingleRowError};
3939
#[derive(Error, Debug, Clone)]
4040
#[non_exhaustive]
4141
pub enum ExecutionError {
42-
/// Failed to prepare the statement.
43-
/// Applies to unprepared statements with non-empty value parameters.
44-
#[error("Failed to prepare the statement: {0}")]
45-
PrepareError(#[from] PrepareError),
46-
47-
/// An error returned by last attempt of request execution.
48-
#[error(transparent)]
49-
LastAttemptError(#[from] RequestAttemptError),
50-
5142
/// Caller passed an invalid query
5243
#[error(transparent)]
5344
BadQuery(#[from] BadQuery),
@@ -61,14 +52,19 @@ pub enum ExecutionError {
6152
)]
6253
EmptyPlan,
6354

64-
/// A metadata error occurred during schema agreement.
65-
#[error("Cluster metadata fetch error occurred during automatic schema agreement: {0}")]
66-
MetadataError(#[from] MetadataError),
55+
/// Failed to prepare the statement.
56+
/// Applies to unprepared statements with non-empty value parameters.
57+
#[error("Failed to prepare the statement: {0}")]
58+
PrepareError(#[from] PrepareError),
6759

6860
/// Selected node's connection pool is in invalid state.
6961
#[error("No connections in the pool: {0}")]
7062
ConnectionPoolError(#[from] ConnectionPoolError),
7163

64+
/// An error returned by last attempt of request execution.
65+
#[error(transparent)]
66+
LastAttemptError(#[from] RequestAttemptError),
67+
7268
/// Failed to run a request within a provided client timeout.
7369
#[error(
7470
"Request execution exceeded a client timeout of {}ms",
@@ -83,6 +79,10 @@ pub enum ExecutionError {
8379
/// Failed to await automatic schema agreement.
8480
#[error("Failed to await schema agreement: {0}")]
8581
SchemaAgreementError(#[from] SchemaAgreementError),
82+
83+
/// A metadata error occurred during schema agreement.
84+
#[error("Cluster metadata fetch error occurred during automatic schema agreement: {0}")]
85+
MetadataError(#[from] MetadataError),
8686
}
8787

8888
impl From<SerializationError> for ExecutionError {

0 commit comments

Comments
 (0)