pub enum TestAppError {
IoError(Error),
ClientError(ApiClientError),
JsonError(Error),
YamlError {
error: String,
},
UnhealthyServer {
timeout: Duration,
},
ServerError(Box<dyn Error + Send + Sync + 'static>),
}
Expand description
Error types for test client operations.
TestAppError
represents all possible errors that can occur during
test client operations, from server startup to OpenAPI generation.
It provides detailed error information to help diagnose test failures.
§Error Categories
- I/O Errors: File operations, network binding issues
- Client Errors: ApiClient configuration and request errors
- Serialization Errors: JSON/YAML parsing and generation errors
- Server Health Errors: Server startup and health check failures
All variants implement standard error traits and provide detailed context for debugging.
Variants§
IoError(Error)
I/O operation failed.
This includes file operations (creating directories, writing files) and network operations (binding to ports, socket operations).
ClientError(ApiClientError)
ApiClient configuration or operation failed.
This wraps errors from the underlying ApiClient, including configuration errors, request failures, and response parsing issues.
JsonError(Error)
JSON serialization or deserialization failed.
This occurs when generating OpenAPI specifications in JSON format or when processing JSON request/response data.
YamlError
YAML serialization failed.
This occurs specifically when generating OpenAPI specifications in YAML format. Contains the detailed error message.
UnhealthyServer
Server failed to become healthy within the timeout period.
This indicates that the test server either failed to start properly or did not respond to health checks within the configured timeout.
§Troubleshooting
- Check server logs for startup errors
- Verify health check implementation
- Increase timeout if server startup is slow
- Ensure no port conflicts with other services
ServerError(Box<dyn Error + Send + Sync + 'static>)
Server operation failed.
This wraps errors from the TestServer implementation, including launch failures and health check errors.
Trait Implementations§
Source§impl Debug for TestAppError
impl Debug for TestAppError
Source§impl Display for TestAppError
impl Display for TestAppError
Source§impl Error for TestAppError
impl Error for TestAppError
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<Error> for TestAppError
impl From<Error> for TestAppError
Source§impl From<Error> for TestAppError
impl From<Error> for TestAppError
Auto Trait Implementations§
impl Freeze for TestAppError
impl !RefUnwindSafe for TestAppError
impl Send for TestAppError
impl Sync for TestAppError
impl Unpin for TestAppError
impl !UnwindSafe for TestAppError
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.