#[non_exhaustive]pub enum GigasttError {
ModelLoad {
path: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
Inference {
source: Box<dyn Error + Send + Sync>,
},
InvalidAudio {
reason: String,
},
Io(Error),
InvalidInput {
message: String,
},
Cancelled,
AudioTooLong {
observed_secs: f64,
limit_secs: f64,
},
}Expand description
Errors returned by gigastt public API methods.
This enum covers the main failure categories:
- Model loading failures (
ModelLoad) - Runtime inference errors (
Inference) - Invalid audio input (
InvalidAudio) - Filesystem / I/O errors (
Io)
§Matching on errors
use gigastt::error::GigasttError;
match err {
GigasttError::ModelLoad { path, .. } => eprintln!("Model problem at {path}"),
GigasttError::Inference { .. } => eprintln!("Inference failed"),
GigasttError::InvalidAudio { reason } => eprintln!("Bad audio: {reason}"),
GigasttError::Io(e) => eprintln!("I/O error: {e}"),
_ => eprintln!("Other error"),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ModelLoad
Model files not found or failed to load ONNX sessions.
Fields
Inference
ONNX inference failed during encode, decode, or join.
InvalidAudio
Invalid audio input (unsupported format, excessive duration, corrupt data).
Io(Error)
Filesystem or I/O error.
InvalidInput
Invalid user-supplied parameter or option (not audio-specific).
Cancelled
The run was cancelled cooperatively before it finished (client
disconnect, DELETE /v1/jobs/{id}, a fired shutdown signal, or the
no-progress inference watchdog). The decode loop observes the abort
signal at a window boundary and returns this so the pooled session is
released promptly instead of running to completion. Additive: the enum
is #[non_exhaustive].
AudioTooLong
The audio exceeded a duration limit and was rejected before it could
exhaust memory. observed_secs is how long the decoded input turned out
to be; limit_secs is the ceiling that fired. Two sources trip this: the
opt-in --max-audio-secs (default 0 = unlimited), and the fixed safety
ceiling that the whole-buffer paths (diarization, channels=split —
including its per-channel Opus decode — and the G.722 / raw telephony
codecs) keep because they must materialize the entire decoded buffer in
RAM. The default streaming file path, the VAD file path, and streamed
OGG/Opus are O(one window) and have no length limit. Additive: the enum
is #[non_exhaustive].
Implementations§
Trait Implementations§
Source§impl Debug for GigasttError
impl Debug for GigasttError
Source§impl Display for GigasttError
impl Display for GigasttError
Source§impl Error for GigasttError
impl Error for GigasttError
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()
Source§impl From<Error> for GigasttError
impl From<Error> for GigasttError
Source§impl From<RuntimeError> for GigasttError
impl From<RuntimeError> for GigasttError
Source§fn from(err: RuntimeError) -> Self
fn from(err: RuntimeError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for GigasttError
impl !UnwindSafe for GigasttError
impl Freeze for GigasttError
impl Send for GigasttError
impl Sync for GigasttError
impl Unpin for GigasttError
impl UnsafeUnpin for GigasttError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.