santh_tracing/error.rs
1use std::fmt;
2
3/// Errors that can occur in `santh-tracing`.
4#[derive(Debug)]
5#[non_exhaustive]
6pub enum Error {
7 /// The global tracing subscriber is already installed.
8 SubscriberAlreadySet,
9}
10
11impl fmt::Display for Error {
12 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
13 match self {
14 Error::SubscriberAlreadySet => write!(
15 f,
16 "Fix: ensure `santh_tracing::init` is called exactly once per process"
17 ),
18 }
19 }
20}
21
22impl std::error::Error for Error {}