pub struct ApiErrorResponse {
pub details: Option<ApiErrorDetail>,
pub error_id: Option<String>,
pub message: String,
pub status: u16,
}Expand description
Structured API error response matching Bullet API format.
All error responses from the trading API conform to this schema.
JSON schema
{
"description": "Structured API error response matching Bullet API format.\n\nAll error responses from the trading API conform to this schema.",
"type": "object",
"required": [
"message",
"status"
],
"properties": {
"details": {
"oneOf": [
{
"type": "null"
},
{
"oneOf": [
{
"$ref": "#/components/schemas/ApiErrorDetail"
}
]
}
]
},
"error_id": {
"description": "Error identifier for support.",
"examples": [
"8b2e4d9f-7a1c-4f0e-9c5d-3e6a8b1c2d4f"
],
"type": [
"string",
"null"
]
},
"message": {
"description": "Human-readable error message.",
"examples": [
"Transaction validation failed: insufficient funds"
],
"type": "string"
},
"status": {
"description": "HTTP status code.",
"examples": [
400
],
"type": "integer",
"format": "uint16",
"minimum": 0.0
}
}
}Fields§
§details: Option<ApiErrorDetail>§error_id: Option<String>Error identifier for support.
message: StringHuman-readable error message.
status: u16HTTP status code.
Implementations§
Source§impl ApiErrorResponse
impl ApiErrorResponse
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Whether this error is potentially transient and the operation could be retried with backoff.
Sourcepub fn is_status_unknown(&self) -> bool
pub fn is_status_unknown(&self) -> bool
Whether the HTTP status code was lost during error conversion.
This happens when the server returns a non-JSON body (e.g. HTML from a
load balancer) that progenitor can’t deserialize. The raw body is
preserved in message, but the status code is unavailable.
Callers may want to treat these as retryable (usually transient proxy
errors) but should be aware that a 4xx with a non-JSON body would also
produce status == 0.
Trait Implementations§
Source§impl Clone for ApiErrorResponse
impl Clone for ApiErrorResponse
Source§fn clone(&self) -> ApiErrorResponse
fn clone(&self) -> ApiErrorResponse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ApiErrorResponse
impl Debug for ApiErrorResponse
Source§impl<'de> Deserialize<'de> for ApiErrorResponse
impl<'de> Deserialize<'de> for ApiErrorResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ApiErrorResponse
impl Display for ApiErrorResponse
Auto Trait Implementations§
impl Freeze for ApiErrorResponse
impl RefUnwindSafe for ApiErrorResponse
impl Send for ApiErrorResponse
impl Sync for ApiErrorResponse
impl Unpin for ApiErrorResponse
impl UnsafeUnpin for ApiErrorResponse
impl UnwindSafe for ApiErrorResponse
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