@@ -15,7 +15,7 @@ use crate::cluster::node::{InternalKnownNode, KnownNode, NodeRef};
15
15
use crate :: cluster:: { Cluster , ClusterNeatDebug , ClusterState } ;
16
16
use crate :: errors:: {
17
17
BadQuery , ExecutionError , MetadataError , NewSessionError , PrepareError , ProtocolError ,
18
- RequestAttemptError , RequestError , TracingProtocolError , UseKeyspaceError ,
18
+ RequestAttemptError , RequestError , TracingError , UseKeyspaceError ,
19
19
} ;
20
20
use crate :: frame:: response:: result;
21
21
#[ cfg( feature = "ssl" ) ]
@@ -1550,7 +1550,7 @@ impl Session {
1550
1550
///
1551
1551
/// See [the book](https://rust-driver.docs.scylladb.com/stable/tracing/tracing.html)
1552
1552
/// for more information about query tracing
1553
- pub async fn get_tracing_info ( & self , tracing_id : & Uuid ) -> Result < TracingInfo , ExecutionError > {
1553
+ pub async fn get_tracing_info ( & self , tracing_id : & Uuid ) -> Result < TracingInfo , TracingError > {
1554
1554
// tracing_info_fetch_attempts is NonZeroU32 so at least one attempt will be made
1555
1555
for _ in 0 ..self . tracing_info_fetch_attempts . get ( ) {
1556
1556
let current_try: Option < TracingInfo > = self
@@ -1563,7 +1563,7 @@ impl Session {
1563
1563
} ;
1564
1564
}
1565
1565
1566
- Err ( ProtocolError :: Tracing ( TracingProtocolError :: EmptyResults ) . into ( ) )
1566
+ Err ( TracingError :: EmptyResults )
1567
1567
}
1568
1568
1569
1569
/// Gets the name of the keyspace that is currently set, or `None` if no
@@ -1588,7 +1588,7 @@ impl Session {
1588
1588
& self ,
1589
1589
tracing_id : & Uuid ,
1590
1590
consistency : Option < Consistency > ,
1591
- ) -> Result < Option < TracingInfo > , ExecutionError > {
1591
+ ) -> Result < Option < TracingInfo > , TracingError > {
1592
1592
// Query system_traces.sessions for TracingInfo
1593
1593
let mut traces_session_query =
1594
1594
Query :: new ( crate :: observability:: tracing:: TRACES_SESSION_QUERY_STR ) ;
@@ -1609,17 +1609,15 @@ impl Session {
1609
1609
// Get tracing info
1610
1610
let maybe_tracing_info: Option < TracingInfo > = traces_session_res
1611
1611
. into_rows_result ( )
1612
- . map_err ( |err| {
1613
- ProtocolError :: Tracing ( TracingProtocolError :: TracesSessionIntoRowsResultError ( err) )
1614
- } ) ?
1612
+ . map_err ( TracingError :: TracesSessionIntoRowsResultError ) ?
1615
1613
. maybe_first_row ( )
1616
1614
. map_err ( |err| match err {
1617
1615
MaybeFirstRowError :: TypeCheckFailed ( e) => {
1618
- ProtocolError :: Tracing ( TracingProtocolError :: TracesSessionInvalidColumnType ( e) )
1616
+ TracingError :: TracesSessionInvalidColumnType ( e)
1617
+ }
1618
+ MaybeFirstRowError :: DeserializationFailed ( e) => {
1619
+ TracingError :: TracesSessionDeserializationFailed ( e)
1619
1620
}
1620
- MaybeFirstRowError :: DeserializationFailed ( e) => ProtocolError :: Tracing (
1621
- TracingProtocolError :: TracesSessionDeserializationFailed ( e) ,
1622
- ) ,
1623
1621
} ) ?;
1624
1622
1625
1623
let mut tracing_info = match maybe_tracing_info {
@@ -1628,20 +1626,16 @@ impl Session {
1628
1626
} ;
1629
1627
1630
1628
// Get tracing events
1631
- let tracing_event_rows_result = traces_events_res. into_rows_result ( ) . map_err ( |err| {
1632
- ProtocolError :: Tracing ( TracingProtocolError :: TracesEventsIntoRowsResultError ( err ) )
1633
- } ) ?;
1629
+ let tracing_event_rows_result = traces_events_res
1630
+ . into_rows_result ( )
1631
+ . map_err ( TracingError :: TracesEventsIntoRowsResultError ) ?;
1634
1632
let tracing_event_rows = tracing_event_rows_result. rows ( ) . map_err ( |err| match err {
1635
- RowsError :: TypeCheckFailed ( err) => {
1636
- ProtocolError :: Tracing ( TracingProtocolError :: TracesEventsInvalidColumnType ( err) )
1637
- }
1633
+ RowsError :: TypeCheckFailed ( err) => TracingError :: TracesEventsInvalidColumnType ( err) ,
1638
1634
} ) ?;
1639
1635
1640
1636
tracing_info. events = tracing_event_rows
1641
1637
. collect :: < Result < _ , _ > > ( )
1642
- . map_err ( |err| {
1643
- ProtocolError :: Tracing ( TracingProtocolError :: TracesEventsDeserializationFailed ( err) )
1644
- } ) ?;
1638
+ . map_err ( TracingError :: TracesEventsDeserializationFailed ) ?;
1645
1639
1646
1640
if tracing_info. events . is_empty ( ) {
1647
1641
return Ok ( None ) ;
0 commit comments