#[non_exhaustive]pub enum Error {
ReadFile {
path: PathBuf,
source: Error,
},
Client {
source: Error,
},
Http {
url: String,
source: Error,
},
Api {
status: u16,
body: String,
},
Redirect {
status: u16,
location: Option<String>,
},
InvalidEndpoint {
url: String,
reason: String,
},
ResponseTooLarge {
got: u64,
limit: u64,
},
BadResponse {
body: String,
},
}Expand description
Everything that can go wrong on the way from an audio file to a transcript.
Non-exhaustive: matching on it must carry a _ arm, so that a future variant is not a
breaking change.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ReadFile
Client
The HTTP client could not be constructed — in practice, TLS backend initialization failing.
Http
Api
Redirect
The endpoint answered with a redirect instead of a transcript.
Deliberately not followed. A 302/303 downgrades POST to GET and drops the body, so the audio would never be uploaded and whatever the target returned would be parsed as a transcript — a silently wrong answer. A 307/308 preserves the method but cannot replay a streamed body. Either way the configuration is what needs fixing.
InvalidEndpoint
The endpoint URL could not be used — empty, unparseable, or not http(s).
ResponseTooLarge
The response was larger than MAX_RESPONSE_BYTES.
BadResponse
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()