pub enum MantaError {
}Expand description
Errors returned by manta-shared’s pure helpers.
Most helpers return Result<T, MantaError>. The server-side code
converts these to its richer BackendError via
crates/manta-server/src/wire_conv.rs::to_backend, which then
maps to HTTP status codes.
§Examples
Pattern-match a NotFound to log a custom message before propagating:
use manta_shared::common::error::MantaError;
fn lookup_thing() -> Result<(), MantaError> {
Err(MantaError::NotFound("thing 42".into()))
}
match lookup_thing() {
Err(MantaError::NotFound(detail)) => {
// Maps to HTTP 404 server-side.
assert_eq!(detail, "thing 42");
}
_ => unreachable!(),
}Variants§
IoError(Error)
Filesystem I/O failure (config-file read, audit-log write, etc.).
ConfigError(ConfigError)
config crate failure: bad TOML, env-var parse, or schema
mismatch on cli.toml / server.toml.
TomlEditError(TomlError)
toml_edit parse / serialize failure when editing a config
file in place (e.g. manta config set).
SerdeError(Error)
JSON serialize / deserialize failure (most often during JWT claim extraction or audit payload construction).
NetError(Error)
reqwest failure on outbound HTTP (DNS, TLS handshake, body
stream, etc.).
YamlError(Error)
YAML parse / serialize failure (SAT-file rendering).
NotFound(String)
Resource lookup failed (config file missing, group not in backend, etc.). Maps to HTTP 404 server-side.
MissingField(String)
A required field is absent (e.g. JWT lacks preferred_username,
node config lacks boot_image_id).
JwtMalformed(String)
JWT was structurally invalid (wrong number of dots, undecodable claims, non-UTF-8 payload). Maps to HTTP 401.
KafkaError(String)
Kafka producer construction or delivery failed.
InvalidPattern(String)
User-supplied pattern (hardware pattern, hostlist expression, glob) didn’t parse. Maps to HTTP 400.
TemplateError(String)
Jinja2 / minijinja render failed during SAT-file processing.
Other(String)
Catch-all for messages that don’t fit any structured variant. Server-side this maps to HTTP 500 — prefer a typed variant when adding new failure modes.
Trait Implementations§
Source§impl Debug for MantaError
impl Debug for MantaError
Source§impl Display for MantaError
impl Display for MantaError
Source§impl Error for MantaError
impl Error for MantaError
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()