pub enum ApiClientError {
Show 22 variants
ReqwestError(Error),
UrlError(ParseError),
HeadersError(Error),
HttpError(Error),
InvalidHeaderName(InvalidHeaderName),
InvalidHeaderValue(InvalidHeaderValue),
JsonValueError(Error),
QuerySerializationError(Error),
AuthenticationError(AuthenticationError),
CallResultRequired,
InvalidBasePath {
error: String,
},
JsonError {
path: String,
error: Error,
body: String,
},
UnsupportedJsonOutput {
output: Output,
name: &'static str,
},
UnsupportedTextOutput {
output: Output,
},
UnsupportedBytesOutput {
output: Output,
},
PathUnresolved {
path: String,
missings: Vec<String>,
},
UnsupportedQueryParameterValue {
value: Value,
},
UnsupportedParameterValue {
message: String,
value: Value,
},
MissingOperation {
id: String,
},
ServerFailure {
raw_body: String,
},
SerializationError {
message: String,
},
UnexpectedStatusCode {
status_code: u16,
body: String,
},
}
Expand description
Errors that can occur when using the ApiClient.
This enum covers all possible error conditions from network issues to data validation failures.
All variants implement std::error::Error
and provide detailed context for debugging.
Variants§
ReqwestError(Error)
HTTP client error from the underlying reqwest library.
Occurs when network requests fail, timeouts occur, or connection issues arise.
UrlError(ParseError)
URL parsing error when constructing request URLs.
Occurs when the base URL or path parameters create an invalid URL.
HeadersError(Error)
HTTP header processing error.
Occurs when header values cannot be processed or are malformed.
HttpError(Error)
HTTP protocol error from the http crate.
Occurs when HTTP protocol constraints are violated.
InvalidHeaderName(InvalidHeaderName)
Invalid HTTP header name.
Occurs when attempting to create headers with invalid names.
InvalidHeaderValue(InvalidHeaderValue)
Invalid HTTP header value.
Occurs when header values contain invalid characters.
JsonValueError(Error)
JSON serialization/deserialization error.
Occurs when working with JSON request bodies or responses.
QuerySerializationError(Error)
Query parameter serialization error.
Occurs when converting structures to URL query strings.
AuthenticationError(AuthenticationError)
Authentication processing error.
Occurs when authentication credentials cannot be processed or are invalid.
CallResultRequired
No call result available for operation.
Occurs when attempting to access response data before making a request.
InvalidBasePath
Invalid base path configuration.
Occurs when the provided base path cannot be used for URL construction.
JsonError
JSON response deserialization failure.
Occurs when the response body cannot be parsed as the expected JSON structure.
Fields
UnsupportedJsonOutput
Response output type is incompatible with JSON deserialization.
Occurs when attempting to parse non-JSON responses as JSON.
Fields
output: Output
The actual response output received.
UnsupportedTextOutput
Response output type is incompatible with text extraction.
Occurs when attempting to extract text from binary or empty responses.
Fields
output: Output
The actual response output received.
UnsupportedBytesOutput
Response output type is incompatible with byte extraction.
Occurs when attempting to extract bytes from empty responses.
Fields
output: Output
The actual response output received.
PathUnresolved
Path template contains unresolved parameters.
Occurs when path parameters are missing for templated URLs.
Fields
UnsupportedQueryParameterValue
Query parameter value type is not supported.
Occurs when attempting to use complex objects as query parameters.
UnsupportedParameterValue
Parameter value cannot be converted to the required format.
Occurs when parameter values are incompatible with their target type.
Fields
MissingOperation
OpenAPI operation not found in the specification.
Occurs when referencing operations that don’t exist in the collected spec.
ServerFailure
Server returned an internal error (HTTP 500).
Occurs when the server encounters an internal error during request processing.
SerializationError
Data serialization failed.
Occurs when request data cannot be converted to the required format.
UnexpectedStatusCode
Server returned an unexpected HTTP status code.
Occurs when the response status code doesn’t match expected values.
Trait Implementations§
Source§impl Debug for ApiClientError
impl Debug for ApiClientError
Source§impl Display for ApiClientError
impl Display for ApiClientError
Source§impl Error for ApiClientError
impl Error for ApiClientError
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
Source§impl From<ApiClientError> for TestAppError
impl From<ApiClientError> for TestAppError
Source§fn from(value: ApiClientError) -> Self
fn from(value: ApiClientError) -> Self
Source§impl From<AuthenticationError> for ApiClientError
impl From<AuthenticationError> for ApiClientError
Source§fn from(value: AuthenticationError) -> Self
fn from(value: AuthenticationError) -> Self
Source§impl From<Error> for ApiClientError
impl From<Error> for ApiClientError
Source§impl From<Error> for ApiClientError
impl From<Error> for ApiClientError
Source§impl From<Error> for ApiClientError
impl From<Error> for ApiClientError
Source§impl From<Error> for ApiClientError
impl From<Error> for ApiClientError
Source§impl From<Error> for ApiClientError
impl From<Error> for ApiClientError
Source§impl From<InvalidHeaderName> for ApiClientError
impl From<InvalidHeaderName> for ApiClientError
Source§fn from(value: InvalidHeaderName) -> Self
fn from(value: InvalidHeaderName) -> Self
Source§impl From<InvalidHeaderValue> for ApiClientError
impl From<InvalidHeaderValue> for ApiClientError
Source§fn from(value: InvalidHeaderValue) -> Self
fn from(value: InvalidHeaderValue) -> Self
Source§impl From<ParseError> for ApiClientError
impl From<ParseError> for ApiClientError
Source§fn from(value: ParseError) -> Self
fn from(value: ParseError) -> Self
Auto Trait Implementations§
impl Freeze for ApiClientError
impl !RefUnwindSafe for ApiClientError
impl Send for ApiClientError
impl Sync for ApiClientError
impl Unpin for ApiClientError
impl !UnwindSafe for ApiClientError
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.