prometheus_32bitfix/
errors.rs1use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum Error {
8 #[error("Duplicate metrics collector registration attempted")]
10 AlreadyReg,
11 #[error("Inconsistent label cardinality, expect {expect} label values, but got {got}")]
13 InconsistentCardinality {
14 expect: usize,
16 got: usize,
18 },
19 #[error("Error: {0}")]
21 Msg(String),
22 #[error("Io error: {0}")]
24 Io(#[from] std::io::Error),
25 #[cfg(feature = "protobuf")]
27 #[error("Protobuf error: {0}")]
28 Protobuf(#[from] protobuf::error::ProtobufError),
29}
30
31pub type Result<T> = std::result::Result<T, Error>;