pub struct RovenueError {
pub kind: ErrorKind,
pub message: String,
pub server_code: Option<String>,
pub http_status: Option<u16>,
pub retryable: bool,
}Expand description
The single error type the core produces and exports across FFI.
Fields§
§kind: ErrorKind§message: String§server_code: Option<String>§http_status: Option<u16>§retryable: boolImplementations§
Source§impl RovenueError
impl RovenueError
Sourcepub fn kind(kind: ErrorKind) -> Self
pub fn kind(kind: ErrorKind) -> Self
Construct from a kind alone (network/store/internal paths).
Sourcepub fn http(
kind: ErrorKind,
status: u16,
server_code: Option<String>,
message: String,
) -> Self
pub fn http( kind: ErrorKind, status: u16, server_code: Option<String>, message: String, ) -> Self
Construct from an HTTP error, preserving the backend code/message.
Sourcepub fn is_poison(&self) -> bool
pub fn is_poison(&self) -> bool
Whether this error is a genuine envelope rejection a durable queue should poison-delete rather than retain.
Narrow on purpose: only 400 (bad request) and 422 (unprocessable
entity) mean the payload itself is malformed and the server will
never accept it, so retaining it would wedge everything queued
behind it forever. Every other 4xx — 401/403 (auth blip or key
rotation), 408 (timeout), 404, 409 (e.g. SubscriberUnresolvable,
which holds the queue until the owner repairs the merge chain),
etc. — is transient from the queue’s point of view and must be
retained: a bad or rotated API key must not permanently drop queued
events, only pause delivery until the key is fixed. Retryable kinds (5xx/network/429) are never
poison either way — the !self.retryable guard is redundant with
the status check today (400/422 both map to non-retryable
InvalidRequest) but keeps this correct if that mapping ever
changes.
Shared by both durable-queue drain sites: events::queue and
sessions::dispatcher. (attributes::dispatcher drops every
non-retryable 4xx except SubscriberUnresolvable.)
Source§impl RovenueError
impl RovenueError
pub fn Internal() -> Self
pub fn ServerError() -> Self
pub fn RateLimited() -> Self
pub fn InvalidApiKey() -> Self
pub fn Timeout() -> Self
pub fn InsufficientCredits() -> Self
pub fn Storage() -> Self
pub fn InvalidArgument() -> Self
pub fn FunnelConfigUnsupported() -> Self
pub fn FunnelInvalid() -> Self
pub fn FunnelTokenNotFound() -> Self
pub fn FunnelTokenExpired() -> Self
pub fn FunnelTokenAlreadyClaimed() -> Self
Trait Implementations§
Source§impl Clone for RovenueError
impl Clone for RovenueError
Source§fn clone(&self) -> RovenueError
fn clone(&self) -> RovenueError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more