use std::{
error::Error,
fmt::{Display, Formatter, Result},
};
#[derive(Debug)]
pub struct QueryError(pub String);
impl Error for QueryError {}
impl Display for QueryError {
fn fmt(&self, f: &mut Formatter) -> Result {
write!(f, "Invalid query parameters passed: {}", self.0)
}
}
#[derive(Debug)]
pub struct NotConfiguredError(pub String);
impl Error for NotConfiguredError {}
impl Display for NotConfiguredError {
fn fmt(&self, f: &mut Formatter) -> Result {
write!(f, "NotConfiguredError: {}", self.0)
}
}
#[derive(Debug)]
pub struct BatchError(pub String);
impl Error for BatchError {}
impl Display for BatchError {
fn fmt(&self, f: &mut Formatter) -> Result {
write!(f, "BatchError: {}", self.0)
}
}
#[derive(Debug)]
pub struct SchemaError(pub String);
impl Error for SchemaError {}
impl Display for SchemaError {
fn fmt(&self, f: &mut Formatter) -> Result {
write!(f, "SchemaError: {}", self.0)
}
}
#[derive(Debug)]
pub struct BackupError(pub String);
impl Error for BackupError {}
impl Display for BackupError {
fn fmt(&self, f: &mut Formatter) -> Result {
write!(f, "BackupError: {}", self.0)
}
}
#[derive(Debug)]
pub struct GraphQLError(pub String);
impl Error for GraphQLError {}
impl Display for GraphQLError {
fn fmt(&self, f: &mut Formatter) -> Result {
write!(f, "Error executing GraphQL query: {}", self.0)
}
}
#[derive(Debug)]
pub struct NodesError(pub String);
impl Error for NodesError {}
impl Display for NodesError {
fn fmt(&self, f: &mut Formatter) -> Result {
write!(f, "NodesError: {}", self.0)
}
}
#[derive(Debug)]
pub struct ClassificationError(pub String);
impl Error for ClassificationError {}
impl Display for ClassificationError {
fn fmt(&self, f: &mut Formatter) -> Result {
write!(f, "ClassificationErEror: {}", self.0)
}
}
#[derive(Debug)]
pub struct ModuleError(pub String);
impl Error for ModuleError {}
impl Display for ModuleError {
fn fmt(&self, f: &mut Formatter) -> Result {
write!(f, "ModuleErEror: {}", self.0)
}
}