pub enum SdkError {
Http(Error),
Api {
status: StatusCode,
body: String,
},
Decode {
source: Error,
body: String,
},
UrlParse(ParseError),
Config(String),
Rpc {
code: i64,
message: String,
},
PaymentUnsupported {
offered: String,
},
PaymentRejected {
status: u16,
body: String,
},
PaymentIndeterminate,
}Variants§
Http(Error)
Api
Decode
UrlParse(ParseError)
Config(String)
Rpc
PaymentUnsupported
No offered payment option matched the caller’s selector (pay_network +
asset), or every match was skipped (over max_amount, unsupported
extra shape, non-integer amount). offered lists what the gateway
presented, for diagnosis. Not retryable without changing the selector.
PaymentRejected
A signed payment was submitted and the gateway rejected it (a second
402, or a non-2xx settlement response). Terminal — the SDK will not
resend. body carries the gateway’s explanation.
PaymentIndeterminate
A paid request was sent but its response was lost (timeout or a
transport error after the bytes may have reached the gateway). The
payment MAY have settled — callers must NOT blindly retry, or they risk
a double charge. Distinct from a plain Http error precisely so this
case can be caught separately.
Implementations§
Trait Implementations§
Source§impl Error for SdkError
impl Error for SdkError
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<ParseError> for SdkError
impl From<ParseError> for SdkError
Source§fn from(source: ParseError) -> Self
fn from(source: ParseError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for SdkError
impl !UnwindSafe for SdkError
impl Freeze for SdkError
impl Send for SdkError
impl Sync for SdkError
impl Unpin for SdkError
impl UnsafeUnpin for SdkError
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.