pub enum Error {
Show 17 variants
NoCacheDir,
Io {
path: PathBuf,
source: Error,
},
Http {
url: String,
source: Error,
},
HttpStatus {
url: String,
status: u16,
},
SizeMismatch {
path: PathBuf,
expected: u64,
actual: u64,
},
Cancelled,
SampleRate {
expected: u32,
actual: u32,
},
Channels {
actual: u16,
},
Capture {
message: String,
},
WorkerSpawn {
message: String,
},
ModelLoad {
path: PathBuf,
message: String,
},
Recognition {
message: String,
},
EngineStopped,
StalePartial {
path: PathBuf,
source: Error,
},
HashMismatch {
path: PathBuf,
expected: String,
actual: String,
},
Catalogue {
message: String,
},
Bench {
message: String,
},
}Expand description
Everything this crate can fail with.
Variants§
NoCacheDir
No models directory was configured and the platform cache directory could not be resolved.
Io
A filesystem operation on path failed. A transfer that dies
mid-body lands here too rather than in Error::Http: it
surfaces while reading the response, and path labels the
partial being written rather than naming what actually failed.
Http
The request failed before any body arrived - connection, TLS, or a refused handshake.
HttpStatus
The server answered, but not with the file.
SizeMismatch
A file on disk is not the length the spec records. The usual cause is an interrupted download that was never resumed.
Cancelled
Work was stopped on request rather than by a fault: a progress
callback returning Break during a fetch, or an abandoned
crate::Ticket aborting an inference.
Whatever already finished is kept - a model that reached
crate::Progress::Ready is installed - and any partial transfer
is left where it is, so a later call resumes rather than starting
over.
SampleRate
The source declares a rate the models cannot read. Rejected rather than resampled: a silent resample yields plausible text from the wrong signal, and nothing downstream can detect that.
Channels
The source declares more than one channel. Interleaved stereo read as mono is a plausible doubled-rate signal, not an error, so it is refused at the boundary.
Capture
Opening or running the input stream failed.
WorkerSpawn
The transcription worker could not be started.
ModelLoad
The weights could not be loaded.
Recognition
Recognition itself failed.
EngineStopped
The worker is gone, so nothing can be transcribed and no queued result will ever arrive.
StalePartial
A partial does not match its spec and could not be removed, so every later call fails identically until someone clears it. The usual cause is a models directory that is not writable.
HashMismatch
A file on disk is the right length but the wrong bytes.
Catalogue
A catalogue document is not an entry this build reads.
Bench
A bench’s corpus could not be read: a wav that is not the shape this crate reads, or a fixture set that disagrees with itself.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()