Skip to main content

ErrorResponse

Type Alias ErrorResponse 

Source
pub type ErrorResponse = Status;
👎Deprecated since 3.0.0: use kube::core::Status instead.Note that the Error::Api constructor based pattern matches have been helper functions due to boxing. See Status docs for the new pattern: https://docs.rs/kube/latest/kube/core/struct.Status.html
Expand description

This type used to be a payload for kube::Error::Api. It has been replaced by Status. In the interest of backward compatibility, we keep this type definition here as a deprecated alias. Status better reflects the Kubernetes API conventions and is more versatile. If you need to migrate your code, simply replace ErrorResponse with Status and also check helper methods implemented on Status for easily identifying common error cases.

As a reference below is the original definition of this type:

An error response from the API. #[derive(Error, Deserialize, Serialize, Debug, Clone, Eq, PartialEq)] #[error(“{message}: {reason}”)] pub struct ErrorResponse { /// The status pub status: String, /// A message about the error #[serde(default)] pub message: String, /// The reason for the error #[serde(default)] pub reason: String, /// The error code pub code: u16, }

Aliased Type§

pub struct ErrorResponse {
    pub status: Option<StatusSummary>,
    pub code: u16,
    pub message: String,
    pub metadata: Option<ListMeta>,
    pub reason: String,
    pub details: Option<StatusDetails>,
}

Fields§

§status: Option<StatusSummary>

Status of the operation

One of: Success or Failure - more info

§code: u16

Suggested HTTP return code (0 if unset)

§message: String

A human-readable description of the status of this operation

§metadata: Option<ListMeta>

Standard list metadata - more info

§reason: String

A machine-readable description of why this operation is in the “Failure” status.

If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.

§details: Option<StatusDetails>

Extended data associated with the reason.

Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type.