Enum testcontainers::core::error::TestcontainersError
source · pub enum TestcontainersError {
Client(ClientError),
WaitContainer(WaitContainerError),
PortNotExposed {
id: String,
port: ContainerPort,
},
MissingInfo(ContainerMissingInfo),
Exec(ExecError),
Io(Error),
Other(Box<dyn Error + Sync + Send>),
}
Expand description
Enum to represent various types of errors that can occur in Testcontainers
Variants§
Client(ClientError)
Represents an error that occurred in the client of Docker API.
WaitContainer(WaitContainerError)
PortNotExposed
Represents an error when a container does not expose a specified port
MissingInfo(ContainerMissingInfo)
Represents an error when a container is missing some information
Exec(ExecError)
Represents an error when an exec operation fails
Io(Error)
Other(Box<dyn Error + Sync + Send>)
Represents any other error that does not fit into the above categories
Implementations§
source§impl TestcontainersError
impl TestcontainersError
sourcepub fn other<E>(error: E) -> Self
pub fn other<E>(error: E) -> Self
Creates a new TestcontainersError
from an arbitrary error payload.
It’s preferably to use the more specific error constructors if possible. But this method is useful when you need to:
- wrap an error that doesn’t fit into the other categories
- avoid introducing a new kind of error in order to keep the error handling simple
- create a custom error from client code.
Trait Implementations§
source§impl Debug for TestcontainersError
impl Debug for TestcontainersError
source§impl Display for TestcontainersError
impl Display for TestcontainersError
source§impl Error for TestcontainersError
impl Error for TestcontainersError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<ClientError> for TestcontainersError
impl From<ClientError> for TestcontainersError
source§fn from(source: ClientError) -> Self
fn from(source: ClientError) -> Self
Converts to this type from the input type.
source§impl From<ContainerMissingInfo> for TestcontainersError
impl From<ContainerMissingInfo> for TestcontainersError
source§fn from(source: ContainerMissingInfo) -> Self
fn from(source: ContainerMissingInfo) -> Self
Converts to this type from the input type.
source§impl From<Error> for TestcontainersError
impl From<Error> for TestcontainersError
source§impl From<ExecError> for TestcontainersError
impl From<ExecError> for TestcontainersError
source§impl From<WaitContainerError> for TestcontainersError
impl From<WaitContainerError> for TestcontainersError
source§fn from(source: WaitContainerError) -> Self
fn from(source: WaitContainerError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for TestcontainersError
impl !RefUnwindSafe for TestcontainersError
impl Send for TestcontainersError
impl Sync for TestcontainersError
impl Unpin for TestcontainersError
impl !UnwindSafe for TestcontainersError
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
Mutably borrows from an owned value. Read more
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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more