MCPcopy Create free account
hub / github.com/aws/aws-lambda-go / reportFailure

Function reportFailure

lambda/invoke_loop.go:104–117  ·  view source on GitHub ↗
(invoke *invoke, invokeErr *messages.InvokeResponse_Error)

Source from the content-addressed store, hash-verified

102}
103
104func reportFailure(invoke *invoke, invokeErr *messages.InvokeResponse_Error) error {
105 errorPayload := safeMarshal(invokeErr)
106 log.Printf("%s", errorPayload)
107
108 causeForXRay, err := json.Marshal(makeXRayError(invokeErr))
109 if err != nil {
110 return fmt.Errorf("unexpected error occurred when serializing the function error cause for X-Ray: %v", err)
111 }
112
113 if err := invoke.failure(bytes.NewReader(errorPayload), contentTypeJSON, causeForXRay); err != nil {
114 return fmt.Errorf("unexpected error occurred when sending the function error to the API: %v", err)
115 }
116 return nil
117}
118
119func callBytesHandlerFunc(ctx context.Context, payload []byte, handler handlerFunc) (response io.Reader, invokeErr *messages.InvokeResponse_Error) {
120 defer func() {

Callers 1

handleInvokeFunction · 0.85

Calls 3

safeMarshalFunction · 0.85
makeXRayErrorFunction · 0.85
failureMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…