Courseiva

DVA-C02 Development with AWS Services Practice Question

Network Topology
$ aws lambda invokefunction-name my-functionpayload '{"key1": "value1"}' output.txtRefer to the exhibit."StatusCode": 200,"ExecutedVersion": "$LATEST","FunctionError": "Unhandled"

A developer runs the AWS CLI command shown. The Lambda function returns a 200 status code but the output file is null and the response includes FunctionError: Unhandled. What does this indicate?

⚠ Common exam trap

Candidates often assume a 200 status code means success, but AWS Lambda's synchronous invocation returns HTTP 200 even for function errors, with the `FunctionError` field distinguishing success from failure.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

The Lambda function threw an unhandled exception.

The presence of `FunctionError: Unhandled` in the response of an `aws lambda invoke` command indicates that the Lambda function encountered an error (such as an unhandled exception or runtime crash) that was not caught by the function's code. Even though the function failed, the Invoke API itself successfully completed the transaction of invoking the function, which is why it returns an HTTP status code of 200.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    The Lambda function timed out.

    Why it's wrong here

    A Lambda timeout typically results in a 504 Gateway Timeout error if invoked via API Gateway, or a Task timed out after X seconds error message in the logs, often accompanied by a 500 Internal Server Error from the Lambda service itself if invoked directly and synchronously. A 200 OK status code, even with a FunctionError header, does not signify a timeout; it indicates the invocation request was successfully processed by the Lambda service, but the function's execution within that request encountered an issue.

  • ✓

    The Lambda function threw an unhandled exception.

    Why this is correct

    When a Lambda function throws an unhandled exception, the Lambda service captures this error and returns a 200 OK HTTP status code to the invoker, but includes a special X-Amz-Function-Error header with the value Unhandled. This header explicitly indicates that the function's execution failed due to an exception that was not caught and handled within the function's code, even though the invocation request itself was successfully received and processed by the Lambda service.

  • ✗

    The payload was too large for synchronous invocation.

    Why it's wrong here

    If the invocation payload exceeds the maximum allowed size for synchronous invocation (6 MB for request body), the Lambda service would reject the request *before* attempting to invoke the function. This would typically result in a 413 Request Entity Too Large HTTP status code or a 400 Bad Request with a specific error message indicating the payload size limit was exceeded, not a 200 OK status code with a FunctionError header.

  • ✗

    The Lambda function was not found.

    Why it's wrong here

    If the specified Lambda function does not exist or the invoking principal lacks permissions to access it, the Lambda service would return a 404 ResourceNotFoundException HTTP status code. A 200 OK status code, even with an error header, signifies that the Lambda service successfully located and attempted to invoke the specified function, implying the function itself was found and accessible and the invocation request was valid.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

About these practice questions

This DVA-C02 question is part of Courseiva's 1,135-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.