use thiserror::Error;
#[derive(Debug, Error)]
pub enum NetcdfError {
#[error("netcdf error: {0}")]
Netcdf(#[from] netcdf::Error),
#[error("no variables found in input")]
NoVariables,
#[error("encode error: {0}")]
Encode(String),
#[error("io error: {0}")]
Io(#[from] std::io::Error),
#[error("invalid netcdf data: {0}")]
InvalidData(String),
#[error("unsupported variable type for '{name}': {reason}")]
UnsupportedType { name: String, reason: String },
#[error("--split-by=record requires an unlimited dimension, none found in {file}")]
NoUnlimitedDimension { file: String },
}