pub enum AgentMuxError {
Show 16 variants
OutOfSpace {
path: String,
source_msg: String,
},
PermissionDenied {
path: String,
source_msg: String,
},
PathNotFound {
path: String,
},
PathTraversal {
path: String,
},
MigrationFailed {
from: u32,
to: u32,
message: String,
},
VersionMismatch {
oid: String,
expected: u64,
actual: u64,
},
CliNotInstalled {
provider: String,
cli: String,
},
NpmInstallFailed {
package: String,
message: String,
},
CliShimMissing {
provider: String,
expected_path: String,
},
CliMissingOnPath {
provider: String,
cli: String,
install_hint: String,
},
AuthRequiresTty {
provider: String,
},
AuthTimeout {
provider: String,
seconds: u64,
},
HttpError {
url: String,
status: Option<u16>,
message: String,
},
SidecarBindFailed {
port: u16,
message: String,
},
AlreadyRunning {
pid: u32,
},
Legacy(String),
}Expand description
The typed error returned by RPC handlers. Serializes to:
{ "code": "AMX-IO-001", "message": "device out of space ...", "details": { ... } }
Variants§
OutOfSpace
PermissionDenied
PathNotFound
PathTraversal
MigrationFailed
VersionMismatch
CliNotInstalled
NpmInstallFailed
CliShimMissing
CliMissingOnPath
AuthRequiresTty
AuthTimeout
HttpError
SidecarBindFailed
AlreadyRunning
Legacy(String)
Implementations§
Source§impl AgentMuxError
impl AgentMuxError
Sourcepub fn code(&self) -> AmxCode
pub fn code(&self) -> AmxCode
Stable code for this variant. Mirrors the JSON code field
the frontend’s catalog looks up.
Sourcepub fn from_io_with_path(path: impl Into<String>, err: Error) -> Self
pub fn from_io_with_path(path: impl Into<String>, err: Error) -> Self
Helper for the common case: an std::io::Error raised while
operating on a known path. Use this at call sites that have
the path on hand — the From<std::io::Error> impl below
can’t recover the path from the bare IO error.
Trait Implementations§
Source§impl Debug for AgentMuxError
impl Debug for AgentMuxError
Source§impl Display for AgentMuxError
impl Display for AgentMuxError
Source§impl Error for AgentMuxError
impl Error for AgentMuxError
1.30.0 · 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
Source§impl From<&str> for AgentMuxError
impl From<&str> for AgentMuxError
Source§impl From<Error> for AgentMuxError
impl From<Error> for AgentMuxError
Source§fn from(err: Error) -> Self
fn from(err: Error) -> Self
Implicit conversion routes by ErrorKind + raw OS code, but
loses the path context. Prefer from_io_with_path at sites
that know which file/dir was being operated on — the empty
path here renders as the literal (unknown path) sentinel
in Display, which leaks into wire message and the
Details disclosure.
Source§impl From<String> for AgentMuxError
Wrap a free-text string in AgentMuxError::Legacy. Used by the
RPC engine to bridge un-migrated handlers that still return
Result<_, String>.
impl From<String> for AgentMuxError
Wrap a free-text string in AgentMuxError::Legacy. Used by the
RPC engine to bridge un-migrated handlers that still return
Result<_, String>.