Skip to main content

CloudFrontError

Enum CloudFrontError 

Source
pub enum CloudFrontError {
    NoSuchResource {
        code: &'static str,
        message: String,
    },
    InvalidArgument(String),
    MissingArgument(String),
    ResourceInUse(String),
    DistributionNotDisabled(String),
    PreconditionFailed(String),
    InvalidIfMatchVersion(String),
    MalformedInput(String),
    AlreadyExists {
        code: &'static str,
        message: String,
    },
    NotImplemented(String),
    AccessDenied(String),
    Internal(String),
}
Expand description

Top-level CloudFront service error.

Each variant maps to an AWS error Code and an HTTP status.

Variants§

§

NoSuchResource

The requested resource does not exist.

Fields

§code: &'static str

AWS error code, e.g. NoSuchDistribution.

§message: String

Human-readable message.

§

InvalidArgument(String)

The caller submitted an invalid argument.

§

MissingArgument(String)

The request references an argument that is missing.

§

ResourceInUse(String)

The resource is already in use.

§

DistributionNotDisabled(String)

The distribution (or similar config resource) is not currently disabled and therefore cannot be deleted.

§

PreconditionFailed(String)

If-Match ETag does not match the current resource ETag.

§

InvalidIfMatchVersion(String)

If-Match header was required but not provided.

§

MalformedInput(String)

The submitted configuration is invalid (referential integrity, shape).

§

AlreadyExists

Attempt to create a resource that already exists.

Fields

§code: &'static str

AWS error code, e.g. DistributionAlreadyExists.

§message: String

Human-readable message.

§

NotImplemented(String)

Feature not supported / not implemented in Rustack.

§

AccessDenied(String)

Access denied.

§

Internal(String)

Generic internal error.

Implementations§

Source§

impl CloudFrontError

Source

pub fn code(&self) -> &'static str

AWS error code string for the wire <Code> element.

Source

pub fn http_status(&self) -> u16

HTTP status code for this error variant.

Source

pub fn message(&self) -> String

Human-readable message.

Source§

impl CloudFrontError

Constructors for convenience.

Source

pub fn no_such_distribution(id: impl Into<String>) -> Self

“NoSuchDistribution” shortcut.

Source

pub fn no_such_invalidation(id: impl Into<String>) -> Self

“NoSuchInvalidation” shortcut.

Source

pub fn no_such_origin_access_control(id: impl Into<String>) -> Self

“NoSuchOriginAccessControl” shortcut.

Source

pub fn no_such_oai(id: impl Into<String>) -> Self

“NoSuchCloudFrontOriginAccessIdentity” shortcut.

Source

pub fn no_such_cache_policy(id: impl Into<String>) -> Self

“NoSuchCachePolicy” shortcut.

Source

pub fn no_such_origin_request_policy(id: impl Into<String>) -> Self

“NoSuchOriginRequestPolicy” shortcut.

Source

pub fn no_such_response_headers_policy(id: impl Into<String>) -> Self

“NoSuchResponseHeadersPolicy” shortcut.

Source

pub fn no_such_public_key(id: impl Into<String>) -> Self

“NoSuchPublicKey” shortcut.

Source

pub fn no_such_resource(kind: &'static str, id: impl Into<String>) -> Self

“NoSuchResource” generic shortcut.

Trait Implementations§

Source§

impl Debug for CloudFrontError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for CloudFrontError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for CloudFrontError

1.30.0 · Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.