Skip to content

Commit 76660fc

Browse files
committed
Log function error on failure
1 parent 14da40f commit 76660fc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lambda/invoke_loop.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"context"
77
"encoding/json"
88
"fmt"
9+
"log"
910
"strconv"
1011
"time"
1112

@@ -47,8 +48,9 @@ func handleInvoke(invoke *invoke, function *Function) error {
4748
}
4849

4950
if functionResponse.Error != nil {
50-
payload := safeMarshal(functionResponse.Error)
51-
if err := invoke.failure(payload, contentTypeJSON); err != nil {
51+
errorPayload := safeMarshal(functionResponse.Error)
52+
log.Printf("%s", errorPayload)
53+
if err := invoke.failure(errorPayload, contentTypeJSON); err != nil {
5254
return fmt.Errorf("unexpected error occurred when sending the function error to the API: %v", err)
5355
}
5456
if functionResponse.Error.ShouldExit {

0 commit comments

Comments
 (0)