1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! Error types for the RunPod SDK.
use crateRunpodBuilderError;
/// 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:
///
/// ```no_run
/// # use runpod_sdk::{Error, Result, RunpodClient};
/// # use runpod_sdk::service::PodsService;
/// # async fn example() -> Result<()> {
/// 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),
/// }
/// # Ok(())
/// # }
/// ```
/// Result type for RunPod API operations.
///
/// This is a convenience type alias for `std::result::Result<T, Error>` that is used
/// throughout the RunPod SDK. All SDK methods that can fail return this Result type.
pub type Result<T, E = Error> = Result;