pub struct ApiError {
pub status: u16,
pub code: String,
pub message: String,
pub request_id: Option<String>,
pub failure: Option<PreconditionFailure>,
pub body: Value,
}Expand description
A refusal from the server, as its JSON error body describes it.
Fields§
§status: u16The HTTP status.
code: StringThe stable machine-readable code, e.g. PRECONDITION_FAILED, VERSION_CONFLICT,
IDEMPOTENCY_CONFLICT, FORBIDDEN, NOT_FOUND.
message: StringHuman-readable detail. Not a contract: do not branch on it.
request_id: Option<String>The server’s request id, when it reported one. Quote it when reporting a problem.
failure: Option<PreconditionFailure>Which predicate failed and what the authority holds, when a transaction was refused for a failed precondition or fence. Nothing was written.
body: ValueThe complete error body, for fields this type does not name.
Trait Implementations§
Source§impl Error for ApiError
impl Error for ApiError
1.30.0 · 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()
Auto Trait Implementations§
impl Freeze for ApiError
impl RefUnwindSafe for ApiError
impl Send for ApiError
impl Sync for ApiError
impl Unpin for ApiError
impl UnsafeUnpin 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