//! Error handling module

pub use crate::ServerError;

/// Helper function to create a 404 response
pub fn not_found() -> ServerError {
    ServerError::Routing(RoutingError::NotFound("Page not found".to_string()))
}

/// Helper function to create a 500 response
pub fn internal_error(msg: impl Into<String>) -> ServerError {
    ServerError::Config(msg.into())
}

/// Convert std::io::Error to ServerError
impl From<std::io::Error> for ServerError {
    fn from(err: std::io::Error) -> Self {
        ServerError::Io(err)
    }
}