pub trait SdkResultExt<T> {
// Required method
fn into_sdk_error(self) -> Result<T, AlienError<GenericError>>;
}Expand description
Extension trait for converting SDK API results to AlienError.
This properly extracts error information from progenitor’s error types,
preserving API error details that would be lost with .into_alien_error().
§When to use
Use into_sdk_error() for SDK API calls:
ⓘ
client.sync_acquire().send().await.into_sdk_error().context(...)?Continue using into_alien_error() for non-SDK errors (serde, std, etc.):
ⓘ
serde_json::to_value(&data).into_alien_error().context(...)?§What it preserves
When the API returns an error response, into_sdk_error() preserves:
code: The API error code (e.g., “AGENT_NOT_FOUND”)message: The error messageretryable: Whether the operation can be retriedcontext: Additional error context as JSONsource: Nested error chain- HTTP status code
Required Methods§
Sourcefn into_sdk_error(self) -> Result<T, AlienError<GenericError>>
fn into_sdk_error(self) -> Result<T, AlienError<GenericError>>
Convert SDK result to AlienError result, preserving API error details.