use core::time::Duration;
use smol_str::SmolStr;
use crate::types::TranscriberError;
#[derive(Debug, thiserror::Error)]
pub enum RunnerError {
#[error("failed to load whisper context: {message}")]
WhisperContextLoad {
message: SmolStr,
},
#[cfg(feature = "alignment")]
#[error("failed to load aligner: {message}")]
AlignerLoad {
message: SmolStr,
},
#[error("whisper pool shutdown (worker channel disconnected)")]
WhisperPoolShutdown,
#[error("backpressure: buffer at {buffered}/{cap} samples")]
Backpressure {
buffered: usize,
cap: usize,
},
#[error("drain exceeded {timeout:?} with {in_flight} chunks still in flight")]
DrainTimeout {
timeout: Duration,
in_flight: usize,
},
#[error("model I/O: {0}")]
Io(#[from] std::io::Error),
#[error("transcriber: {0}")]
Transcriber(#[from] TranscriberError),
}