Expand description
The Lambda runtime errors crate defines the LambdaErrorExt trait
that can be used by libriaries to return errors compatible with the
AWS Lambda Rust runtime.
This crate also exports the lambda_runtime_errors_derive crate to
derive the LambdaErrorExt trait.
use lambda_runtime_errors::*;
// the generated error_type() method returns "crate::LambdaError"
#[derive(LambdaErrorExt)]
struct LambdaError;Structs§
- Handler
Error - The
HandlerErrorstruct can be use to abstract anyErrof the handler methodResult. TheHandlerErrorobject can be generatedFromany object that supportsDisplay,Send,Sync, andDebug. This allows handler functions to return any error using the?syntax. For examplelet _age_num: u8 = e.age.parse()?;will return the::Err` from the handler function.
Traits§
- Lambda
Error Ext - The
LambdaErrorExttrait defines theerror_type()method used by the AWS Lambda runtime client to generateErrorResponseobjects. The value returned by theerror_type()method is used to populate theerrorTypefield in the Lambda response. This crate includes an implementation of this trait for most errors in the standard library. By default, error return their type name. - Lambda
Result Ext Resulttype extension for AWS that makes it easy to generate aHandlerErrorobject or aCompat<Error>from the failure crate using an existing result. This trait should be imported from thelambda_runtime_coreorlambda_runtimecrates.