pub enum TtsError {
Connect(String),
VoiceFetch(String),
Parse(String),
Ws(Box<Error>),
Io(Error),
NoAudio,
}Expand description
All ways a synthesis request can fail.
Callers typically propagate this with ? or match on a variant to
decide whether to retry (e.g. TtsError::Connect after a network blip).
Variants§
Connect(String)
The WebSocket handshake or DRM-token auth failed after all retry attempts. The inner string is the last underlying error message.
VoiceFetch(String)
The voice-catalogue HTTPS fetch failed (DNS, transport, HTTP framing). The inner string is the underlying error message.
Parse(String)
A voice-list JSON body could not be deserialized. The inner string is the underlying serde error message.
Ws(Box<Error>)
Transport-level WebSocket error (handshake, frame decode, TLS).
The tungstenite::Error is boxed to keep TtsError small: it is the
largest variant and threads through every Result<_, TtsError> on the
stack. Boxing it allocates only on the rare error path.
Io(Error)
I/O error on the underlying TCP stream, including receive idle timeout.
NoAudio
The turn completed (or the stream closed) without any audio frames.
Trait Implementations§
Source§impl Error for TtsError
impl Error for TtsError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()