pub enum GuardAgentError {
Config(ConfigError),
BufferFull {
capacity: usize,
},
RateLimited {
retry_after_seconds: f64,
},
Permanent {
status_code: u16,
detail: String,
},
PayloadTooLarge {
detail: String,
},
Transport(String),
Serialization(Error),
Redis(String),
Encryption(String),
EncryptionConfig(String),
}Expand description
Root error type for every fallible operation in the agent.
The public API is deliberately narrow about what can fail:
GuardAgent::new surfaces
GuardAgentError::Config, and
GuardAgent::try_send_event can
surface GuardAgentError::BufferFull when the overflow policy is
BufferOverflowPolicy::Raise. Every
transport, flush, and persistence failure is absorbed by the agent and
reported through stats, logs, and the optional on_error hook instead,
mirroring the failure-isolation policy of the Python and TypeScript agents.
Variants§
Config(ConfigError)
The agent configuration failed validation.
BufferFull
The buffer is full and the configured overflow policy is raise.
RateLimited
The ingestion API responded with 429 Too Many Requests.
Permanent
The request was permanently rejected (400, 404, 422) and will never be retried. The affected batch is dropped by the flush layer.
Fields
PayloadTooLarge
The request body exceeded the server payload cap (413).
Transport(String)
A non-permanent transport-level failure (network, timeout, 5xx, authentication, circuit breaker open, unparseable response, …).
Serialization(Error)
A payload could not be serialized.
Redis(String)
A Redis persistence operation failed.
Encryption(String)
An encryption operation failed (mirrors the Python EncryptionError).
EncryptionConfig(String)
Encryption initialization failed; plaintext fallback is forbidden
(mirrors the Python EncryptionConfigError).
Trait Implementations§
Source§impl Debug for GuardAgentError
impl Debug for GuardAgentError
Source§impl Display for GuardAgentError
impl Display for GuardAgentError
Source§impl Error for GuardAgentError
impl Error for GuardAgentError
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()