aptos_testcontainer/errors.rs
1/// Enum to represent errors related to operations with the `AptosContainer`.
2#[derive(thiserror::Error, Debug)]
3pub enum AptosContainerError {
4 /// Represents an IO error, wrapping a standard `std::io::Error`.
5 #[error("io error {0}")]
6 IOError(#[from] std::io::Error),
7
8 /// Indicates that the file size is too large, providing the file path and its size in MB.
9 #[error("file {path}:{size}MB is too big (max: 1MB)")]
10 FileSizeTooBig {
11 /// The path of the file that is too large.
12 path: String,
13 /// The size of the file in megabytes.
14 size: f64,
15 },
16
17 /// Represents an error where a Docker exec command failed, providing the returned code.
18 #[error("docker exec failed with returned code: {0}")]
19 DockerExecFailed(i64),
20
21 /// Indicates that a command failed to execute, providing the command and the associated stderr output.
22 #[error("run command {command} failed: {stderr}")]
23 CommandFailed {
24 /// The command that was executed and failed.
25 command: String,
26 /// The standard error output from the command execution.
27 stderr: String,
28 },
29}