#[non_exhaustive]pub enum Error {
Http(Error),
Serialization(Error),
Config(RunpodBuilderError),
Job(String),
}Expand description
Error type for RunPod API operations.
This enum represents all possible errors that can occur when using the RunPod SDK, from HTTP transport errors to API-specific failures and configuration issues.
§Examples
Handling different error types:
let client: RunpodClient = RunpodClient::from_env()?;
match client.list_pods(Default::default()).await {
Ok(pods) => println!("Found {} pods", pods.len()),
Err(Error::Http(e)) => println!("Network error: {}", e),
Err(Error::Config(e)) => println!("Configuration error: {}", e),
Err(e) => println!("Other error: {}", e),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Http(Error)
HTTP transport error from the underlying HTTP client.
This includes network connectivity issues, DNS resolution failures, timeout errors, and other transport-layer problems.
Serialization(Error)
serverless only.JSON serialization/deserialization error.
This occurs when the SDK fails to parse API responses or serialize request payloads to/from JSON.
Config(RunpodBuilderError)
Configuration error.
This occurs when configuration parameters are invalid or when using the configuration builder and validation fails during the build process.
Job(String)
serverless only.Job operation error.
This occurs when attempting to perform operations on a job that is in an invalid state.
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
Source§impl From<RunpodBuilderError> for Error
impl From<RunpodBuilderError> for Error
Source§fn from(source: RunpodBuilderError) -> Self
fn from(source: RunpodBuilderError) -> Self
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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.