Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail task upon function execution error #36

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
'FunctionError' field is not set in the response, i.e it is either nu…
…ll or empty string
  • Loading branch information
rickard.cardell committed May 29, 2020
commit 9d7cb68ecd45e986194571a663e34c439269fd49
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ void handleResponse(
final long backoffTimeMs) {

String functionError = response.getErrorString();
if (! functionError.isEmpty()) {
if (functionError != null && !functionError.isEmpty()) {
//function-error
throw new FunctionExecutionException(MessageFormat
.format("Lambda function execution failed. Reason: {0}: {1}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void testHandleResponseWhenFunctionExecutionFails() {
public void testHandleResponseWhenFunctionInvocationAndExecutionSucceeds() {

LambdaSinkTask task = new LambdaSinkTask();
InvocationResponse invocationResponse = new InvocationResponse(200, "test log", "", null, Instant.now(), Instant.now());
InvocationResponse invocationResponse = new InvocationResponse(200, "test log", null, null, Instant.now(), Instant.now());
AtomicInteger retryCounter = new AtomicInteger(2);

task.handleResponse(invocationResponse, retryCounter, Arrays.asList(501,504), 3, 1L);
Expand Down