pub enum KobeApiError {
HttpError(Error),
JsonError(Error),
ApiError {
status_code: u16,
message: String,
},
InvalidParameter(String),
NotFound(String),
RateLimitExceeded,
Timeout,
InvalidUrl(String),
Other(String),
}Expand description
Error types for Jito API client
Variants§
HttpError(Error)
HTTP request error
JsonError(Error)
JSON serialization/deserialization error
ApiError
API returned an error response
InvalidParameter(String)
Invalid parameter provided
NotFound(String)
Resource not found
RateLimitExceeded
Rate limit exceeded
Timeout
Timeout error
InvalidUrl(String)
Invalid URL
Other(String)
Other errors
Implementations§
Source§impl KobeApiError
impl KobeApiError
Sourcepub fn api_error(status_code: u16, message: impl Into<String>) -> Self
pub fn api_error(status_code: u16, message: impl Into<String>) -> Self
Create an API error from status code and message
Sourcepub fn invalid_parameter(message: impl Into<String>) -> Self
pub fn invalid_parameter(message: impl Into<String>) -> Self
Create an invalid parameter error
Sourcepub fn is_rate_limit(&self) -> bool
pub fn is_rate_limit(&self) -> bool
Check if error is a rate limit error
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Check if error is a not found error
Trait Implementations§
Source§impl Debug for KobeApiError
impl Debug for KobeApiError
Source§impl Display for KobeApiError
impl Display for KobeApiError
Source§impl Error for KobeApiError
impl Error for KobeApiError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<Error> for KobeApiError
impl From<Error> for KobeApiError
Auto Trait Implementations§
impl Freeze for KobeApiError
impl !RefUnwindSafe for KobeApiError
impl Send for KobeApiError
impl Sync for KobeApiError
impl Unpin for KobeApiError
impl !UnwindSafe for KobeApiError
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> 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.