Courseiva

DVA-C02 Development with AWS Services Practice Question

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

A developer invokes a Lambda function using the AWS CLI. The response shows StatusCode 200 and FunctionError: Unhandled. What does this indicate?

⚠ Common exam trap

Candidates often assume a 200 HTTP status code always means success, but AWS Lambda uses 200 for all synchronous invocations that reach the service, and the actual error state is indicated by the FunctionError field in the response body, not the HTTP status code.

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 exception that was not caught by the code.

A is correct because a StatusCode 200 from an AWS Lambda invocation via the AWS CLI indicates that the invocation request itself was accepted and processed by the Lambda service, but the presence of FunctionError: Unhandled means the function code threw an exception that was not caught by any try-catch block or error handler. This results in the Lambda service returning a 200 HTTP status for the invocation request while signaling the error via the FunctionError field in the response payload.

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 threw an exception that was not caught by the code.

    Why this is correct

    The presence of the `X-Amz-Function-Error` header in the response, along with a `StatusCode: 200`, is the definitive indicator that the Lambda service successfully received and attempted to execute the function, but the function's code itself encountered an unhandled exception. This means an error occurred within the function's runtime environment that was not caught by a `try-catch` block or equivalent error handling mechanism. Consequently, the Lambda service reported the internal function error back to the invoker.

  • ✗

    The Lambda function timed out before completing.

    Why it's wrong here

    A Lambda function timeout would typically result in a different error message and potentially a different HTTP status code from the Lambda service itself, such as a `500 Internal Server Error` with a specific timeout message in the response body. The exhibit shows a `StatusCode: 200`, indicating the invocation request was successfully processed by the Lambda service, but the `X-Amz-Function-Error` header points to an error originating from within the function's execution, not a service-level timeout.

  • ✗

    The Lambda function executed successfully without errors.

    Why it's wrong here

    The `X-Amz-Function-Error` header explicitly signals that an error occurred during the Lambda function's execution. If the function had executed successfully without errors, this header would be entirely absent from the response. A successful invocation would typically return the function's intended output payload and no error-related headers, confirming a smooth completion of the function's logic.

  • ✗

    The AWS CLI failed to invoke the function due to permissions.

    Why it's wrong here

    If the AWS CLI failed to invoke the function due to insufficient permissions, the invocation request would be rejected by the AWS API Gateway or Lambda service before the function even began execution. This would result in an HTTP status code like `403 Forbidden` from the AWS API, not a `StatusCode: 200`. The `StatusCode: 200` confirms that the invocation request itself was authorized and successfully delivered to the Lambda runtime environment.

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.