Skip to main content

anyclaw_sdk_runtime/
error.rs

1use thiserror::Error;
2
3/// Errors that can occur in runtime SDK operations.
4#[derive(Debug, Error)]
5#[non_exhaustive]
6pub enum RuntimeSdkError {
7    /// The runtime failed to start the environment.
8    #[error("start failed: {0}")]
9    StartFailed(String),
10
11    /// A process execution request failed.
12    #[error("exec failed: {0}")]
13    ExecFailed(String),
14
15    /// The runtime is not in a valid state for the requested operation.
16    #[error("invalid state: {0}")]
17    InvalidState(String),
18
19    /// A protocol-level error (JSON-RPC framing, unexpected message).
20    #[error("protocol error: {0}")]
21    Protocol(String),
22
23    /// An I/O error occurred.
24    #[error("io error: {0}")]
25    Io(#[from] std::io::Error),
26}