pub struct ApiError {
pub code: String,
pub message: String,
}Expand description
Kraken API error codes and messages.
These are errors returned by the Kraken API itself in the response body.
Fields§
§code: StringThe error code/identifier from Kraken (e.g., “EGeneral:Invalid arguments”)
message: StringHuman-readable error message
Implementations§
Source§impl ApiError
impl ApiError
Sourcepub fn new(code: impl Into<String>, message: impl Into<String>) -> Self
pub fn new(code: impl Into<String>, message: impl Into<String>) -> Self
Create a new API error from code and message.
Sourcepub fn from_error_array(errors: &[String]) -> Option<Self>
pub fn from_error_array(errors: &[String]) -> Option<Self>
Parse API error from Kraken’s error array format.
Kraken returns errors as an array like ["EGeneral:Invalid arguments"]
Sourcepub fn is_rate_limit(&self) -> bool
pub fn is_rate_limit(&self) -> bool
Check if this is a rate limit error.
Sourcepub fn is_invalid_nonce(&self) -> bool
pub fn is_invalid_nonce(&self) -> bool
Check if this is an invalid nonce error.
Sourcepub fn is_invalid_key(&self) -> bool
pub fn is_invalid_key(&self) -> bool
Check if this is an invalid key error.
Sourcepub fn is_invalid_signature(&self) -> bool
pub fn is_invalid_signature(&self) -> bool
Check if this is an invalid signature error.
Sourcepub fn is_permission_denied(&self) -> bool
pub fn is_permission_denied(&self) -> bool
Check if this is a permission denied error.
Check if this is a service unavailable error.
Trait Implementations§
impl Eq for ApiError
impl StructuralPartialEq for ApiError
Auto Trait Implementations§
impl Freeze for ApiError
impl RefUnwindSafe for ApiError
impl Send for ApiError
impl Sync for ApiError
impl Unpin for ApiError
impl UnwindSafe for ApiError
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.