invocation_response::failure does not work with HTTP API Gateway ?

Open
#117 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
aws, cpp
Domain
api, backend

Research direction

Start by tracing invocation_response::failure through run_handler and compare its behavior with invocation_response::success when called through HTTP API Gateway. Reproduce the sample handler using the stated Amazon Linux C++ runtime, then determine whether the observed HTTP 500 is expected or identifies a runtime failure; done means the behavior is explained and verified.

Written by the indexing model from the issue text.

Description

I'm using the HTTP API Gateway, my c++ runtime is built with amazonlinux:latest in a docker image.
All responses that return with invocation_response::failure return an Error 500, Internal Server Error.

#include <aws/lambda-runtime/runtime.h>
using namespace aws::lambda_runtime;
static invocation_response my_handler(invocation_request const& req)
{
  return invocation_response::failure("error message here"/*error_message*/, "error type here" /*error_type*/);
}

int main()
{
    run_handler(my_handler);
    return 0;
}

However, when I use invocation_response::success, the message arrives on my requesting client, but I ofc. can only send json objects back. (Anyone got an idea why that is ?)

I read everything google found and digged through all kinds of files and aws docus, I could not find out where the problem is. Could someone please give me a hint if the args have to match some specific ones or what I am doing wrong ?
Thanks!

Dominant language
C++
Stars
465
Forks
98
Avg merge
1h 16m
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from awslabs/aws-lambda-cpp

All issues in awslabs/aws-lambda-cpp

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.