use mlx_rs::error::Exception;
use thiserror::Error;
pub type Result<T> = std::result::Result<T, VocoderError>;
#[derive(Error, Debug)]
pub enum VocoderError {
#[error("MLX error: {0}")]
Mlx(#[from] Exception),
#[error("Configuration error: {0}")]
Config(String),
#[error("Weight loading error: {0}")]
WeightLoad(String),
#[error("Shape mismatch: expected {expected:?}, got {actual:?}")]
ShapeMismatch {
expected: Vec<i32>,
actual: Vec<i32>,
},
#[error("Audio error: {0}")]
Audio(String),
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("Serialization error: {0}")]
Serialization(String),
#[error("Hub error: {0}")]
Hub(String),
}