Skip to content

Commit

Permalink
ESM-v2: Fix batch item failure message and reference to unbound varia…
Browse files Browse the repository at this point in the history
  • Loading branch information
gregfurman authored Sep 10, 2024
1 parent 04cfa50 commit 9663d6d
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ def send_events(self, events: list[dict]) -> dict:
**optional_qualifier,
)
payload = json.load(invoke_result["Payload"])
if "FunctionError" in invoke_result:
function_error = invoke_result["FunctionError"]
if function_error := invoke_result.get("FunctionError"):
LOG.debug(
"Pipe target function %s failed with FunctionError %s. Payload: %s",
self.target_arn,
Expand Down Expand Up @@ -85,8 +84,6 @@ def send_events(self, events: list[dict]) -> dict:
"requestId": invoke_result["ResponseMetadata"]["RequestId"],
"exceptionType": "BadRequest",
"resourceArn": self.target_arn,
"functionError": function_error,
"executedVersion": invoke_result.get("ExecutedVersion", "$LATEST"),
}
raise PartialFailureSenderError(error=error, partial_failure_payload=payload)

Expand Down

0 comments on commit 9663d6d

Please sign in to comment.