use thiserror::Error;
#[derive(Debug, Error)]
pub enum GeodesicError {
#[error("Configuration error: {0}")]
ConfigError(String),
#[error("Render error: {0}")]
RenderError(String),
#[error("Surface error: {0}")]
SurfaceError(String),
#[error("Window error: {0}")]
WindowError(String),
}
impl GeodesicError {
pub fn config(msg: impl Into<String>) -> Self {
GeodesicError::ConfigError(msg.into())
}
pub fn render(msg: impl Into<String>) -> Self {
GeodesicError::RenderError(msg.into())
}
pub fn surface(msg: impl Into<String>) -> Self {
GeodesicError::SurfaceError(msg.into())
}
pub fn window(msg: impl Into<String>) -> Self {
GeodesicError::WindowError(msg.into())
}
}