Enum openapi_lambda::error::EventError
source · #[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
Fields
Failed to parse request path parameter.
InvalidRequestQueryParam
Fields
Failed to parse request query param.
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
Fields
Failed to serialize response body to JSON.
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.