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

Function makeXRayError

lambda/invoke_loop.go:188–212  ·  view source on GitHub ↗
(invokeResponseError *messages.InvokeResponse_Error)

Source from the content-addressed store, hash-verified

186}
187
188func makeXRayError(invokeResponseError *messages.InvokeResponse_Error) *xrayError {
189 paths := make([]string, 0, len(invokeResponseError.StackTrace))
190 visitedPaths := make(map[string]struct{}, len(invokeResponseError.StackTrace))
191 for _, frame := range invokeResponseError.StackTrace {
192 if _, exists := visitedPaths[frame.Path]; !exists {
193 visitedPaths[frame.Path] = struct{}{}
194 paths = append(paths, frame.Path)
195 }
196 }
197
198 cwd, _ := os.Getwd()
199 exceptions := []xrayException{{
200 Type: invokeResponseError.Type,
201 Message: invokeResponseError.Message,
202 Stack: invokeResponseError.StackTrace,
203 }}
204 if exceptions[0].Stack == nil {
205 exceptions[0].Stack = []*messages.InvokeResponse_Error_StackFrame{}
206 }
207 return &xrayError{
208 WorkingDirectory: cwd,
209 Paths: paths,
210 Exceptions: exceptions,
211 }
212}

Callers 1

reportFailureFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…