#[non_exhaustive]pub enum EventError {
Show 14 variants
HttpResponse(Box<Error>, Backtrace),
InvalidBodyBase64(Box<DecodeError>, Backtrace),
InvalidBodyJson(Box<Error<Error>>, Backtrace),
InvalidBodyUtf8(Box<FromUtf8Error>, Backtrace),
InvalidHeaderUtf8(HeaderName, Box<dyn Error + Send + Sync + 'static>, Backtrace),
InvalidRequestPathParam {
param_name: Cow<'static, str>,
source: Option<Box<dyn Error + Send + Sync + 'static>>,
backtrace: Backtrace,
},
InvalidRequestQueryParam {
param_name: Cow<'static, str>,
source: Option<Box<dyn Error + Send + Sync + 'static>>,
backtrace: Backtrace,
},
MissingRequestBody(Backtrace),
MissingRequestHeader(Cow<'static, str>, Backtrace),
MissingRequestParam(Cow<'static, str>, Backtrace),
Panic(String, Backtrace),
ToJsonResponse {
type_name: Cow<'static, str>,
source: Box<Error<Error>>,
backtrace: Backtrace,
},
UnexpectedContentType(String, Backtrace),
UnexpectedOperationId(String, Backtrace),
}
Expand description
Error that occurred while processing an AWS Lambda event.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
HttpResponse(Box<Error>, Backtrace)
Failed to prepare HTTP response.
InvalidBodyBase64(Box<DecodeError>, Backtrace)
Invalid base64 encoding for request body.
InvalidBodyJson(Box<Error<Error>>, Backtrace)
Failed to JSON deserialize request body.
InvalidBodyUtf8(Box<FromUtf8Error>, Backtrace)
Invalid UTF-8 encoding for request body.
InvalidHeaderUtf8(HeaderName, Box<dyn Error + Send + Sync + 'static>, Backtrace)
Invalid UTF-8 encoding for request header.
InvalidRequestPathParam
Failed to parse request path parameter.
Fields
InvalidRequestQueryParam
Failed to parse request query param.
Fields
MissingRequestBody(Backtrace)
Missing required request body.
MissingRequestHeader(Cow<'static, str>, Backtrace)
Missing required request header.
MissingRequestParam(Cow<'static, str>, Backtrace)
Missing required request param.
Panic(String, Backtrace)
Request handler panicked.
ToJsonResponse
Failed to serialize response body to JSON.
Fields
UnexpectedContentType(String, Backtrace)
Unexpected request Content-Type.
UnexpectedOperationId(String, Backtrace)
Unexpected operation ID.
Implementations§
Source§impl EventError
impl EventError
Trait Implementations§
Source§impl Debug for EventError
impl Debug for EventError
Source§impl Display for EventError
impl Display for EventError
Source§impl Error for EventError
impl Error for EventError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<&EventError> for HttpResponse
impl From<&EventError> for HttpResponse
Source§fn from(err: &EventError) -> HttpResponse
fn from(err: &EventError) -> HttpResponse
Build a client-facing HttpResponse
appropriate for the error that occurred.
This function will set the appropriate HTTP status code (400 or 500) depending on whether the
error is internal (500) or caused by the client (400). For client errors, the
response body contains a human-readable description of the error and the Content-Type
response header is set to text/plain
. For internal errors, no response body is returned to
the client.
Source§impl From<EventError> for HttpResponse
impl From<EventError> for HttpResponse
Source§fn from(err: EventError) -> HttpResponse
fn from(err: EventError) -> HttpResponse
Auto Trait Implementations§
impl !Freeze for EventError
impl !RefUnwindSafe for EventError
impl Send for EventError
impl Sync for EventError
impl Unpin for EventError
impl !UnwindSafe for EventError
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more