call_handler

in lib/aws_lambda_ric/lambda_handler.rb [19:42]


  def call_handler(request:, context:)
    opts = {
      event: request,
      context: context
    }
    if @handler_class
      response = Kernel.const_get(@handler_class).send(@handler_method_name, **opts)
    else
      response = __send__(@handler_method_name, **opts)
    end
    
    AwsLambda::Marshaller.marshall_response(response)
  rescue NoMethodError => e
    
    raise LambdaErrors::LambdaHandlerCriticalException.new(e)
  rescue NameError => e
    
    raise LambdaErrors::LambdaHandlerCriticalException.new(e)
  rescue StandardError => e
    raise LambdaErrors::LambdaHandlerError.new(e)
  rescue Exception => e
    raise LambdaErrors::LambdaHandlerCriticalException.new(e)
  end