rustainers/port/
error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use crate::runner::RunnerError;
use crate::Port;

/// Port error
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum PortError {
    /// Invalid port mapping
    #[error("Invalid port mapping, expect a `<host port>:<container port>`, got {0}")]
    InvalidPortMapping(String),

    /// The port is not yet bind
    #[error("Container port {0} not bind")]
    PortNotBindYet(Port),

    /// The container port not found
    #[error("Container port {0} not found")]
    ContainerPortNotFound(Port),

    /// The container is failing
    #[error(transparent)]
    RunnerError(#[from] RunnerError),
}