zlayer_init_actions/
error.rs1use std::time::Duration;
4use thiserror::Error;
5
6#[derive(Debug, Error)]
8pub enum InitError {
9 #[error("TCP connection to {host}:{port} failed: {reason}")]
11 TcpFailed {
12 host: String,
13 port: u16,
14 reason: String,
15 },
16
17 #[error("HTTP request to {url} failed: {reason}")]
19 HttpFailed { url: String, reason: String },
20
21 #[error("Command '{command}' failed with exit code {code}")]
23 CommandFailed {
24 command: String,
25 code: i32,
26 stdout: String,
27 stderr: String,
28 },
29
30 #[error("Timeout exceeded: {timeout:?}")]
32 Timeout { timeout: Duration },
33
34 #[error("Unknown init action: {0}")]
36 UnknownAction(String),
37
38 #[error("Invalid parameters for action '{action}': {reason}")]
40 InvalidParams { action: String, reason: String },
41
42 #[cfg(feature = "s3")]
44 #[error("S3 operation failed for {bucket}/{key}: {reason}")]
45 S3Failed {
46 bucket: String,
47 key: String,
48 reason: String,
49 },
50}
51
52pub type Result<T, E = InitError> = std::result::Result<T, E>;