use std::{fmt::Display, io};
use thiserror::Error;
#[derive(Error, Debug)]
pub enum PrometheusError {
#[error("failed to write to output: {0}")]
Write(#[from] io::Error),
#[error("serde internal error: {0}")]
Custom(String),
}
impl serde::ser::Error for PrometheusError {
fn custom<T>(msg: T) -> Self
where
T: Display,
{
Self::Custom(msg.to_string())
}
}