Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Merge pull request #5 from kayac/feature/fix-error-report
Browse files Browse the repository at this point in the history
fix ErrorHandling
  • Loading branch information
mashiike authored Jun 29, 2020
2 parents 33b46b6 + 85fc2df commit 518b9c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sendInitError () {
ERROR_MESSAGE=$1
ERROR_TYPE=$2
ERROR="{\"errorMessage\": \"$ERROR_MESSAGE\", \"errorType\": \"$ERROR_TYPE\"}"
curl -sS -X POST -d "$ERROR" "http://${AWS_LAMBDA_RUNTIME_API}/${RUNTIME_PATH}/init/error" > /dev/null
curl -sS -X POST -d "$ERROR" --header "Lambda-Runtime-Function-Error-Type: Unhandled" "http://${AWS_LAMBDA_RUNTIME_API}/${RUNTIME_PATH}/init/error" > /dev/null
}

# Send runtime error to Lambda API
Expand All @@ -24,7 +24,8 @@ sendRuntimeError () {
ERROR_TYPE=$3
STACK_TRACE=$4
ERROR="{\"errorMessage\": \"$ERROR_MESSAGE\", \"errorType\": \"$ERROR_TYPE\", \"stackTrace\": \"$STACK_TRACE\"}"
curl -sS -X POST -d "$ERROR" "http://${AWS_LAMBDA_RUNTIME_API}/${RUNTIME_PATH}/invocation/${REQUEST_ID}/error" > /dev/null
curl -sS -X POST -d "$ERROR" --header "Lambda-Runtime-Function-Error-Type: Unhandled" "http://${AWS_LAMBDA_RUNTIME_API}/${RUNTIME_PATH}/invocation/${REQUEST_ID}/error" > /dev/null

}

# Send successful response to Lambda API
Expand Down

0 comments on commit 518b9c0

Please sign in to comment.