#[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
use the Display impl or to_string()