pub enum ClientError {
PathNotAbsolute(String),
PathNotNormalized(String),
PathReadOnly(String),
ProcessNotFound(u32),
ShellNotFound(String),
SessionNotFound(String),
Kernel {
code: String,
message: String,
},
InvalidSchedule(String),
PastSchedule(String),
Transport(ProtocolCodecError),
Sidecar(String),
}Expand description
Typed error taxonomy for the client SDK.
Variants§
PathNotAbsolute(String)
A filesystem path was not absolute (did not start with /).
The message text matches the TypeScript AgentOs exactly (capital “P”). These strings are
observable data (they surface in BatchWriteResult.error / BatchReadResult.error), not
logs, so the casing follows TS rather than the lowercase log convention.
PathNotNormalized(String)
A filesystem path was not in posix-normalized form.
The message text matches the TypeScript AgentOs exactly (capital “P”).
PathReadOnly(String)
A write was attempted against a read-only path (for example /proc).
The message text matches the TypeScript AgentOs exactly (capital “P”).
ProcessNotFound(u32)
An SDK-spawned process with the given pid was not found.
The message text matches the TypeScript AgentOs exactly (capital “P”). These strings are
observable data (surfaced to callers), not logs, so the casing follows TS rather than the
lowercase log convention.
ShellNotFound(String)
A shell with the given synthetic shell-N id was not found.
SessionNotFound(String)
An ACP session with the given id was not found.
Kernel
A kernel/sidecar operation failed. The errno code string (ENOENT, EEXIST, ENOTDIR,
EACCES, EISDIR, ENOTEMPTY, …) is preserved verbatim for parity with the TypeScript
KernelError.
InvalidSchedule(String)
A cron schedule string could not be parsed/validated.
PastSchedule(String)
A one-shot (ISO-8601) cron schedule resolved to a time in the past.
Transport(ProtocolCodecError)
A framing/codec failure on the sidecar transport.
Sidecar(String)
A generic sidecar rejection or I/O failure with context.
Implementations§
Source§impl ClientError
impl ClientError
Sourcepub fn batch_message(&self) -> String
pub fn batch_message(&self) -> String
Render this error the way the TypeScript AgentOs surfaces err.message into batch results
(BatchWriteResult.error / BatchReadResult.error).
The general Display impl carries a human/log-oriented prefix
(kernel error [<code>]: ...), but the batch surface is observable data that must match TS
byte-for-byte. For kernel failures TS reports KernelError.message, which is
<code>: <message> (and avoids doubling the code when the message already starts with it).
Path-guard variants already carry the exact TS strings via their Display impl.
Trait Implementations§
Source§impl Debug for ClientError
impl Debug for ClientError
Source§impl Display for ClientError
impl Display for ClientError
Source§impl Error for ClientError
impl Error for ClientError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()