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
use the Display impl or to_string()