diff --git a/testcontainers/Cargo.toml b/testcontainers/Cargo.toml index 628b9026..10dbe12b 100644 --- a/testcontainers/Cargo.toml +++ b/testcontainers/Cargo.toml @@ -33,6 +33,7 @@ serde_with = "3.7.0" signal-hook = { version = "0.3", optional = true } tokio = { version = "1", features = ["macros", "fs", "rt-multi-thread"] } tokio-util = "0.7.10" +thiserror = "1.0.60" url = { version = "2", features = ["serde"] } [features] diff --git a/testcontainers/src/core/logs.rs b/testcontainers/src/core/logs.rs index 4df7c0ec..0c648002 100644 --- a/testcontainers/src/core/logs.rs +++ b/testcontainers/src/core/logs.rs @@ -52,12 +52,14 @@ fn end_of_stream(expected_msg: &str, lines: Vec) -> WaitError { } /// Defines error cases when waiting for a message in a stream. -#[derive(Debug)] +#[derive(Debug, thiserror::Error)] pub enum WaitError { /// Indicates the stream ended before finding the log line you were looking for. /// Contains all the lines that were read for debugging purposes. - EndOfStream(#[allow(dead_code)] Vec), // todo: tuple is used by Debug impl, remove once nightly clippy is fixed - Io(#[allow(dead_code)] io::Error), + #[error("End of stream reached: {0:?}")] + EndOfStream(Vec), + #[error(transparent)] + Io(io::Error), } impl From for WaitError {