#[derive(Debug, thiserror::Error)]
pub enum RumError {
#[error("missing required config field: {0}")]
MissingConfig(&'static str),
#[error("invalid config value for {field}: {message}")]
InvalidConfig {
field: &'static str,
message: String,
},
#[error("invalid trace context for {field}: {message}")]
InvalidTraceContext {
field: &'static str,
message: String,
},
#[error("RUM SDK is already initialized")]
AlreadyInitialized,
#[error("RUM SDK is not initialized")]
NotInitialized,
#[error("RUM SDK has been shut down")]
Shutdown,
#[error("request error: {0}")]
Reqwest(#[from] reqwest::Error),
#[cfg(feature = "reqwest")]
#[error("request middleware error: {0}")]
ReqwestMiddleware(#[from] reqwest_middleware::Error),
#[error("url parse error: {0}")]
Url(#[from] url::ParseError),
#[error("json error: {0}")]
Json(#[from] serde_json::Error),
#[error("exporter queue is full")]
QueueFull,
#[error("channel closed")]
ChannelClosed,
}
pub type Result<T> = std::result::Result<T, RumError>;