#[non_exhaustive]pub struct ApiError {
pub http_status: Option<u16>,
pub status: String,
pub reason: String,
pub metadata: HashMap<String, String>,
pub message: String,
pub request_id: String,
pub field_violations: Vec<FieldViolation>,
pub retry_delay: Option<Duration>,
/* private fields */
}Expand description
A call the API refused, or an operation that failed.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.http_status: Option<u16>The response’s HTTP status code; None for an operation’s error.
status: StringThe closest canonical code, such as NOT_FOUND, for generic
tooling.
reason: StringThe platform’s error code, such as NOT_FOUND or CONFLICT: what
to branch on.
metadata: HashMap<String, String>More about the reason, by name, such as serviceAccount, the name
of the service account an earlier request with the same request id
created; empty when the API sends none.
message: StringWhat went wrong, for a person.
request_id: StringIdentifies the request to Origin Cloud’s support.
field_violations: Vec<FieldViolation>The request fields that were refused.
retry_delay: Option<Duration>How long the API asks to wait before trying again; None when it
doesn’t ask.
Implementations§
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()
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 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