use std::fmt;
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct ServerError {
pub upstream: String,
}
impl ServerError {
pub fn new(upstream: &str) -> Self {
ServerError {
upstream: String::from(upstream),
}
}
}
impl fmt::Display for ServerError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "server error, upstream message: {}", self.upstream)
}
}