pub enum PaykitError {
Transport {
context: String,
source: Error,
},
NotFound(String),
InvalidData {
context: String,
source: Option<Error>,
},
Validation(String),
}Expand description
Domain-specific error type.
Variants that wrap an underlying cause carry a source field backed by
anyhow::Error so that the standard std::error::Error::source chain
is preserved while keeping the public API decoupled from upstream error
types. Callers can downcast the source via anyhow::Error::downcast_ref
when they need the original typed error.
Variants§
Transport
Wrapper for transport layer failures.
Most user-facing failures bubble up through this variant, encapsulating lower-level SDK/network errors (timeouts, connection refused, permission denied, etc.).
Fields
NotFound(String)
The requested resource does not exist.
Returned when a payment endpoint or other resource is not found (404/GONE).
InvalidData
Retrieved data is corrupt or structurally invalid.
Returned when a resource was successfully fetched from the network but its
content cannot be interpreted — for example invalid UTF-8 bytes or an
unparseable resource path. This is distinct from
PaykitError::Transport (the network call itself failed).
Fields
Validation(String)
Input failed validation.
Returned when a caller-supplied value (such as a crate::PaymentEndpointIdentifier) violates
structural invariants — for example containing path-traversal sequences,
null bytes, or characters outside the allowed set.
Implementations§
Source§impl PaykitError
impl PaykitError
Sourcepub fn is_non_retryable_private_send_error(&self) -> bool
pub fn is_non_retryable_private_send_error(&self) -> bool
Returns true when this error came from a deterministic Encrypted Link private-message send failure that should trigger link recovery instead of ordinary transport retry.
Sourcepub fn is_non_retryable_private_receive_error(&self) -> bool
pub fn is_non_retryable_private_receive_error(&self) -> bool
Returns true when this error came from a deterministic Encrypted Link private-message receive failure that should trigger link recovery instead of ordinary transport retry.
Trait Implementations§
Source§impl Debug for PaykitError
impl Debug for PaykitError
Source§impl Display for PaykitError
impl Display for PaykitError
Source§impl Error for PaykitError
impl Error for PaykitError
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()
Source§impl From<PaykitError> for HandshakeAdvanceError
impl From<PaykitError> for HandshakeAdvanceError
Source§fn from(error: PaykitError) -> Self
fn from(error: PaykitError) -> Self
Auto Trait Implementations§
impl Freeze for PaykitError
impl RefUnwindSafe for PaykitError
impl Send for PaykitError
impl Sync for PaykitError
impl Unpin for PaykitError
impl UnsafeUnpin for PaykitError
impl UnwindSafe for PaykitError
Blanket Implementations§
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> 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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.