1#[derive(thiserror::Error, Debug)]
19pub enum TestError {
20 #[error("Startup problem: {0}")]
22 Startup(String),
23
24 #[error("Low level I/O problem: {0}")]
26 Io(#[from] std::io::Error),
27
28 #[error("Low level Docker problem: {0}")]
30 Docker(#[from] DockerError),
31
32 #[error("Configuration not supported: {0}")]
34 NotSupportedConfig(String),
35
36 #[error("Unknown service of type `{0}`")]
38 UnknownService(&'static str),
39
40 #[error("Unknown service hostname `{0}`")]
43 UnknownServiceHostname(String),
44
45 #[error("Unavailable runtime: {0}")]
47 UnavailableRuntime(#[from] UnavailableRuntimeError),
48
49 #[error("Multithread runtime required")]
52 UnavailableMultiThread,
53
54 #[error("Unable to pick new ports")]
56 UnavailablePorts,
57
58 #[error("Unable to connect to docker daemon.")]
60 UnavailableDocker(DockerError),
61
62 #[error("Can not retrieve credentials. Reason: `{0}`")]
64 CredentialRetrieval(#[from] CredentialRetrievalError),
65}
66
67#[derive(thiserror::Error, Debug)]
69#[error(transparent)]
70pub struct CredentialRetrievalError(#[from] docker_credential::CredentialRetrievalError);
71
72impl From<docker_credential::CredentialRetrievalError> for TestError {
73 fn from(value: docker_credential::CredentialRetrievalError) -> Self {
74 CredentialRetrievalError(value).into()
75 }
76}
77
78#[derive(thiserror::Error, Debug)]
80#[error(transparent)]
81pub struct DockerError(#[from] bollard::errors::Error);
82
83impl From<bollard::errors::Error> for TestError {
84 fn from(value: bollard::errors::Error) -> Self {
85 DockerError(value).into()
86 }
87}
88
89#[derive(thiserror::Error, Debug)]
91#[error(transparent)]
92pub struct UnavailableRuntimeError(#[from] tokio::runtime::TryCurrentError);
93
94impl From<tokio::runtime::TryCurrentError> for TestError {
95 fn from(value: tokio::runtime::TryCurrentError) -> Self {
96 UnavailableRuntimeError(value).into()
97 }
98}