@@ -5,7 +5,7 @@ use crate::telemetry::error::TelemetryError;
5
5
use crate :: trace_exporter:: msgpack_decoder:: v04:: error:: DecodeError ;
6
6
use hyper:: http:: StatusCode ;
7
7
use hyper:: Error as HyperError ;
8
- use serde_json :: error :: Error as SerdeError ;
8
+ use rmp_serde :: encode :: Error as EncodeError ;
9
9
use std:: error:: Error ;
10
10
use std:: fmt:: { Debug , Display } ;
11
11
@@ -111,18 +111,25 @@ impl RequestError {
111
111
/// TraceExporterError holds different types of errors that occur when handling traces.
112
112
#[ derive( Debug ) ]
113
113
pub enum TraceExporterError {
114
+ /// Error in agent response processing.
114
115
Agent ( AgentErrorKind ) ,
116
+ /// Invalid builder input.
115
117
Builder ( BuilderErrorKind ) ,
118
+ /// Error in deserialization of incoming trace payload.
116
119
Deserialization ( DecodeError ) ,
120
+ /// Generic IO error.
117
121
Io ( std:: io:: Error ) ,
122
+ /// Network related error (i.e. hyper error).
118
123
Network ( NetworkError ) ,
124
+ /// Agent responded with an error code.
119
125
Request ( RequestError ) ,
120
- Serde ( SerdeError ) ,
126
+ /// Error in serialization of processed trace payload.
127
+ Serialization ( EncodeError ) ,
121
128
}
122
129
123
- impl From < serde_json :: error :: Error > for TraceExporterError {
124
- fn from ( value : SerdeError ) -> Self {
125
- TraceExporterError :: Serde ( value)
130
+ impl From < EncodeError > for TraceExporterError {
131
+ fn from ( value : EncodeError ) -> Self {
132
+ TraceExporterError :: Serialization ( value)
126
133
}
127
134
}
128
135
@@ -188,7 +195,7 @@ impl Display for TraceExporterError {
188
195
TraceExporterError :: Io ( e) => std:: fmt:: Display :: fmt ( e, f) ,
189
196
TraceExporterError :: Network ( e) => std:: fmt:: Display :: fmt ( e, f) ,
190
197
TraceExporterError :: Request ( e) => std:: fmt:: Display :: fmt ( e, f) ,
191
- TraceExporterError :: Serde ( e) => std:: fmt:: Display :: fmt ( e, f) ,
198
+ TraceExporterError :: Serialization ( e) => std:: fmt:: Display :: fmt ( e, f) ,
192
199
}
193
200
}
194
201
}
0 commit comments