Skip to content

Commit c0cec59

Browse files
author
Graham Krizek
committed
Add comments to runtime
1 parent 4fcc044 commit c0cec59

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bootstrap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,18 @@ do
4747
REQUEST_ID=$(grep -Fi Lambda-Runtime-Aws-Request-Id "$HEADERS" | tr -d '[:space:]' | cut -d: -f2)
4848
# Workaround until this is a layer
4949
export PATH=$PATH:/var/task/bin
50+
# Execute the user function
5051
$(echo "$_HANDLER" | cut -d. -f2) "$EVENT_DATA" >&1 2> $RESPONSE | cat
5152
EXIT_CODE=$?
53+
# Respond to Lambda API
5254
if [[ $EXIT_CODE -eq "0" ]]; then
5355
sendResponse "$REQUEST_ID" "$(cat $RESPONSE)"
5456
else
57+
# Log error to stdout as well
5558
cat $RESPONSE
5659
sendRuntimeError "$REQUEST_ID" "Exited with code $EXIT_CODE" "RuntimeErrorException" "$(cat $RESPONSE)"
5760
fi
61+
# Clean up
5862
rm -f $HEADERS
5963
rm -f $RESPONSE
6064
done

0 commit comments

Comments
 (0)