pub enum ComposioError {
ApiError {
status: u16,
message: String,
code: Option<String>,
slug: Option<String>,
request_id: Option<String>,
suggested_fix: Option<String>,
errors: Option<Vec<ErrorDetail>>,
},
NetworkError(Error),
SerializationError(Error),
InvalidInput(String),
ConfigError(String),
}Expand description
Main error type for the Composio SDK
Variants§
ApiError
API error returned from Composio backend
Fields
§
errors: Option<Vec<ErrorDetail>>NetworkError(Error)
Network error from HTTP client
SerializationError(Error)
JSON serialization error
InvalidInput(String)
Invalid input provided by user
ConfigError(String)
Configuration error
Implementations§
Source§impl ComposioError
impl ComposioError
Sourcepub async fn from_response(response: Response) -> Self
pub async fn from_response(response: Response) -> Self
Create an ApiError from an HTTP response
This method attempts to parse the response body as an ErrorResponse. If parsing fails, it creates a generic ApiError with the status code.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if this error should be retried
Returns true for transient errors that may succeed on retry:
- 429 (Rate Limited)
- 500 (Internal Server Error)
- 502 (Bad Gateway)
- 503 (Service Unavailable)
- 504 (Gateway Timeout)
- Network errors
Returns false for client errors (4xx except 429) that won’t succeed on retry.
Trait Implementations§
Source§impl Debug for ComposioError
impl Debug for ComposioError
Source§impl Display for ComposioError
impl Display for ComposioError
Source§impl Error for ComposioError
impl Error for ComposioError
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<Error> for ComposioError
impl From<Error> for ComposioError
Auto Trait Implementations§
impl Freeze for ComposioError
impl !RefUnwindSafe for ComposioError
impl Send for ComposioError
impl Sync for ComposioError
impl Unpin for ComposioError
impl UnsafeUnpin for ComposioError
impl !UnwindSafe for ComposioError
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