use std::path::PathBuf;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum CheqError {
#[error("Atomic parameters not found for element with atomic number: {0}")]
ParameterNotFound(u8),
#[error(
"SCF failed to converge after {max_iterations} iterations. Final charge difference: {delta:.2e}"
)]
NotConverged {
max_iterations: u32,
delta: f64,
},
#[error("Failed to solve the linear matrix system: {0}")]
LinalgError(String),
#[error("I/O error at path '{path}': {source}")]
IoError {
path: PathBuf,
#[source]
source: std::io::Error,
},
#[error("Failed to deserialize TOML parameters: {0}")]
DeserializationError(#[from] toml::de::Error),
#[error("Input validation failed: at least one atom is required for a calculation")]
NoAtoms,
}