Skip to content
Branch: master
Find file Copy path
Find file Copy path
3 contributors

Users who have contributed to this file

@davidbarsky @sapessi @Sh4rK
37 lines (29 sloc) 812 Bytes
use std::error::Error;
use lambda_runtime::{error::HandlerError, lambda, Context};
use log::{self, error};
use serde_derive::{Deserialize, Serialize};
use simple_error::bail;
use simple_logger;
struct CustomEvent {
#[serde(rename = "firstName")]
first_name: String,
struct CustomOutput {
message: String,
fn main() -> Result<(), Box<dyn Error>> {
fn my_handler(e: CustomEvent, c: Context) -> Result<CustomOutput, HandlerError> {
if e.first_name == "" {
error!("Empty first name in request {}", c.aws_request_id);
bail!("Empty first name");
Ok(CustomOutput {
message: format!("Hello, {}!", e.first_name),
You can’t perform that action at this time.