pub enum ApifyClientError {
Api(Box<ApiError>),
Http(String),
Timeout,
Serde(Error),
InvalidResponse(String),
InvalidArgument(String),
}Expand description
The top-level error type for all client operations.
Variants§
Api(Box<ApiError>)
The API returned a non-success status code with a structured error body.
Boxed to keep the overall Result size small (the error path is rare).
Http(String)
A network/transport-level error occurred (connection failure, timeout, etc.).
Timeout
The request timed out.
Serde(Error)
Failed to serialize the request body or deserialize the response body.
InvalidResponse(String)
The response body could not be interpreted as expected.
InvalidArgument(String)
A required configuration value or argument was missing or invalid.
Implementations§
Source§impl ApifyClientError
impl ApifyClientError
Sourcepub fn as_api_error(&self) -> Option<&ApiError>
pub fn as_api_error(&self) -> Option<&ApiError>
Returns the underlying ApiError if this is an API error, otherwise None.
Sourcepub fn status_code(&self) -> Option<u16>
pub fn status_code(&self) -> Option<u16>
Returns the HTTP status code if this error originated from an API response.
Trait Implementations§
Source§impl Debug for ApifyClientError
impl Debug for ApifyClientError
Source§impl Display for ApifyClientError
impl Display for ApifyClientError
Source§impl Error for ApifyClientError
impl Error for ApifyClientError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<ApiError> for ApifyClientError
impl From<ApiError> for ApifyClientError
Source§impl From<Error> for ApifyClientError
impl From<Error> for ApifyClientError
Auto Trait Implementations§
impl !RefUnwindSafe for ApifyClientError
impl !UnwindSafe for ApifyClientError
impl Freeze for ApifyClientError
impl Send for ApifyClientError
impl Sync for ApifyClientError
impl Unpin for ApifyClientError
impl UnsafeUnpin for ApifyClientError
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
Mutably borrows from an owned value. Read more