#[non_exhaustive]pub enum ErrorCode {
Show 15 variants
InvalidInput,
ParseFailed,
SecurityVerificationFailed,
DecryptionFailed,
PolicyViolation,
TransportFailure,
InteropViolation,
ReliabilityFailure,
NotFound,
CapacityExhausted,
PayloadTooLarge,
StorageBackendFailure,
CertificateRevoked,
CertificateExpired,
Timeout,
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidInput
ParseFailed
SecurityVerificationFailed
DecryptionFailed
PolicyViolation
TransportFailure
InteropViolation
ReliabilityFailure
NotFound
A requested resource (e.g. SMP endpoint, profile) does not exist.
CapacityExhausted
A bounded resource (e.g. conversation gate, connection pool) has no remaining capacity. Callers should shed load or retry after a delay.
PayloadTooLarge
The inbound request body exceeds the configured size limit.
HTTP semantics: respond with 413 Content Too Large.
StorageBackendFailure
A storage or infrastructure backend (dedup store, reconciliation queue, audit sink) failed with an I/O or connectivity error.
This is distinct from ReliabilityFailure
(protocol-level duplicate/ordering failure) and from
TransportFailure (network/HTTP failure).
HTTP semantics: respond with 503 Service Unavailable — the server is temporarily unable to handle the request due to a backend outage.
CertificateRevoked
The partner’s certificate has been revoked by its issuing CA.
Distinct from SecurityVerificationFailed
(which covers signature/chain errors) so that monitoring can page on revocation
separately from transient verification failures.
HTTP semantics: 403 Forbidden — the certificate is permanently invalid.
CertificateExpired
The partner’s certificate has passed its notAfter validity date.
Distinct from SecurityVerificationFailed
so that operations teams receive a targeted remediation hint (rotate the
partner cert) rather than a generic security failure alert.
HTTP semantics: 403 Forbidden.
Timeout
A network or I/O operation timed out before completing.
Distinct from TransportFailure (which covers
protocol/TLS errors) so that callers can apply timeout-specific retry
policies (e.g., exponential back-off with jitter rather than immediate retry).
HTTP semantics: 504 Gateway Timeout when acting as a proxy/client.
Implementations§
Source§impl ErrorCode
impl ErrorCode
pub fn as_str(self) -> &'static str
Sourcepub fn to_http_status(self) -> u16
pub fn to_http_status(self) -> u16
Returns the canonical HTTP status code for this error.
Embedders can use this in transport adapters to map AsxError to HTTP
responses without writing a custom match. For errors that represent
an external failure (e.g., TransportFailure), the code is 5xx; for
caller-induced errors it is 4xx.
| Variant | HTTP status |
|---|---|
InvalidInput | 400 |
ParseFailed | 400 |
SecurityVerificationFailed | 401 |
DecryptionFailed | 400 |
PolicyViolation | 422 |
TransportFailure | 502 |
InteropViolation | 400 |
ReliabilityFailure | 503 |
NotFound | 404 |
CapacityExhausted | 429 |
PayloadTooLarge | 413 |
StorageBackendFailure | 503 |
CertificateRevoked | 403 |
CertificateExpired | 403 |
Timeout | 504 |
Sourcepub fn remediation_hint(self) -> Option<&'static str>
pub fn remediation_hint(self) -> Option<&'static str>
A short operator-facing remediation hint for the most common failure
codes, or None for failures that require caller-specific diagnosis.
Intended for structured logging and monitoring dashboards; not a substitute for full error context.
Trait Implementations§
impl Copy for ErrorCode
impl Eq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnsafeUnpin for ErrorCode
impl UnwindSafe for ErrorCode
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more