@@ -16,7 +16,7 @@ use crate::cluster::node::{InternalKnownNode, KnownNode, NodeRef};
1616use crate :: cluster:: { Cluster , ClusterNeatDebug , ClusterState } ;
1717use crate :: errors:: {
1818 BadQuery , ExecutionError , MetadataError , NewSessionError , ProtocolError , RequestAttemptError ,
19- RequestError , TracingProtocolError , UseKeyspaceError ,
19+ RequestError , TracingError , UseKeyspaceError ,
2020} ;
2121use crate :: frame:: response:: result;
2222#[ cfg( feature = "ssl" ) ]
@@ -1742,7 +1742,7 @@ where
17421742 ///
17431743 /// See [the book](https://rust-driver.docs.scylladb.com/stable/tracing/tracing.html)
17441744 /// for more information about query tracing
1745- pub async fn get_tracing_info ( & self , tracing_id : & Uuid ) -> Result < TracingInfo , ExecutionError > {
1745+ pub async fn get_tracing_info ( & self , tracing_id : & Uuid ) -> Result < TracingInfo , TracingError > {
17461746 // tracing_info_fetch_attempts is NonZeroU32 so at least one attempt will be made
17471747 for _ in 0 ..self . tracing_info_fetch_attempts . get ( ) {
17481748 let current_try: Option < TracingInfo > = self
@@ -1755,7 +1755,7 @@ where
17551755 } ;
17561756 }
17571757
1758- Err ( ProtocolError :: Tracing ( TracingProtocolError :: EmptyResults ) . into ( ) )
1758+ Err ( TracingError :: EmptyResults )
17591759 }
17601760
17611761 /// Gets the name of the keyspace that is currently set, or `None` if no
@@ -1780,7 +1780,7 @@ where
17801780 & self ,
17811781 tracing_id : & Uuid ,
17821782 consistency : Option < Consistency > ,
1783- ) -> Result < Option < TracingInfo > , ExecutionError > {
1783+ ) -> Result < Option < TracingInfo > , TracingError > {
17841784 // Query system_traces.sessions for TracingInfo
17851785 let mut traces_session_query =
17861786 Query :: new ( crate :: observability:: tracing:: TRACES_SESSION_QUERY_STR ) ;
@@ -1801,17 +1801,15 @@ where
18011801 // Get tracing info
18021802 let maybe_tracing_info: Option < TracingInfo > = traces_session_res
18031803 . into_rows_result ( )
1804- . map_err ( |err| {
1805- ProtocolError :: Tracing ( TracingProtocolError :: TracesSessionIntoRowsResultError ( err) )
1806- } ) ?
1804+ . map_err ( TracingError :: TracesSessionIntoRowsResultError ) ?
18071805 . maybe_first_row ( )
18081806 . map_err ( |err| match err {
18091807 MaybeFirstRowError :: TypeCheckFailed ( e) => {
1810- ProtocolError :: Tracing ( TracingProtocolError :: TracesSessionInvalidColumnType ( e) )
1808+ TracingError :: TracesSessionInvalidColumnType ( e)
1809+ }
1810+ MaybeFirstRowError :: DeserializationFailed ( e) => {
1811+ TracingError :: TracesSessionDeserializationFailed ( e)
18111812 }
1812- MaybeFirstRowError :: DeserializationFailed ( e) => ProtocolError :: Tracing (
1813- TracingProtocolError :: TracesSessionDeserializationFailed ( e) ,
1814- ) ,
18151813 } ) ?;
18161814
18171815 let mut tracing_info = match maybe_tracing_info {
@@ -1820,20 +1818,16 @@ where
18201818 } ;
18211819
18221820 // Get tracing events
1823- let tracing_event_rows_result = traces_events_res. into_rows_result ( ) . map_err ( |err| {
1824- ProtocolError :: Tracing ( TracingProtocolError :: TracesEventsIntoRowsResultError ( err ) )
1825- } ) ?;
1821+ let tracing_event_rows_result = traces_events_res
1822+ . into_rows_result ( )
1823+ . map_err ( TracingError :: TracesEventsIntoRowsResultError ) ?;
18261824 let tracing_event_rows = tracing_event_rows_result. rows ( ) . map_err ( |err| match err {
1827- RowsError :: TypeCheckFailed ( err) => {
1828- ProtocolError :: Tracing ( TracingProtocolError :: TracesEventsInvalidColumnType ( err) )
1829- }
1825+ RowsError :: TypeCheckFailed ( err) => TracingError :: TracesEventsInvalidColumnType ( err) ,
18301826 } ) ?;
18311827
18321828 tracing_info. events = tracing_event_rows
18331829 . collect :: < Result < _ , _ > > ( )
1834- . map_err ( |err| {
1835- ProtocolError :: Tracing ( TracingProtocolError :: TracesEventsDeserializationFailed ( err) )
1836- } ) ?;
1830+ . map_err ( TracingError :: TracesEventsDeserializationFailed ) ?;
18371831
18381832 if tracing_info. events . is_empty ( ) {
18391833 return Ok ( None ) ;
0 commit comments