//! Custom error for tnnl.
//! Do not use directly.
use std::fmt::Display;
#[derive(Debug)]
pub struct AppError {
message: String,
}
impl AppError {
pub(crate) fn new<T: ToString>(message: T) -> Self {
Self {
message: message.to_string(),
}
}
}
impl Display for AppError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_fmt(format_args!("AppError: {}", self.message))
}
}