pub enum MoldError {
Validation(String),
Download(String),
Config(String),
Client(String),
ModelNotFound(String),
Inference(String),
RunPod(String),
RunPodAuth(String),
RunPodNotFound(String),
RunPodNoStock(String),
Other(Error),
}Expand description
Primary error type for the mold crate ecosystem.
Provides structured error variants for the main failure modes so callers
can pattern-match on specific categories instead of string-matching.
The Other variant accepts any anyhow::Error as a catch-all.
Variants§
Validation(String)
Request validation failures (bad dimensions, empty prompt, etc.)
Download(String)
Download/network issues
Config(String)
Config parsing/loading errors
Client(String)
HTTP client communication errors
ModelNotFound(String)
Model doesn’t exist or isn’t downloaded
Inference(String)
Inference/generation errors
RunPod(String)
Generic RunPod API error (non-auth, non-not-found)
RunPodAuth(String)
RunPod authentication failure (401/403 or missing/invalid API key)
RunPodNotFound(String)
RunPod resource not found (404)
RunPodNoStock(String)
RunPod could not schedule the pod (no machines available)
Other(Error)
Catch-all for everything else
Trait Implementations§
Source§impl Error for MoldError
impl Error for MoldError
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<DownloadError> for MoldError
impl From<DownloadError> for MoldError
Source§fn from(err: DownloadError) -> Self
fn from(err: DownloadError) -> Self
Auto Trait Implementations§
impl Freeze for MoldError
impl RefUnwindSafe for MoldError
impl Send for MoldError
impl Sync for MoldError
impl Unpin for MoldError
impl UnsafeUnpin for MoldError
impl UnwindSafe for MoldError
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<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.