use thiserror::Error;
#[derive(Error, Debug)]
pub enum PolyscopeError {
#[error("polyscope not initialized - call polyscope_rs::init() first")]
NotInitialized,
#[error("polyscope already initialized")]
AlreadyInitialized,
#[error("structure '{0}' already exists")]
StructureExists(String),
#[error("structure '{0}' not found")]
StructureNotFound(String),
#[error("quantity '{0}' already exists on structure '{1}'")]
QuantityExists(String, String),
#[error("quantity '{0}' not found on structure '{1}'")]
QuantityNotFound(String, String),
#[error("material '{0}' already exists")]
MaterialExists(String),
#[error("material load error: {0}")]
MaterialLoadError(String),
#[error("data size mismatch: expected {expected}, got {actual}")]
SizeMismatch { expected: usize, actual: usize },
#[error("render error: {0}")]
RenderError(String),
#[error("I/O error: {0}")]
IoError(#[from] std::io::Error),
#[error("JSON error: {0}")]
JsonError(#[from] serde_json::Error),
}
pub type Result<T> = std::result::Result<T, PolyscopeError>;