MCPcopy Index your code
hub / github.com/aws/aws-lambda-go / TestRPCModeInvokeReaderErrorPropogated

Function TestRPCModeInvokeReaderErrorPropogated

lambda/rpc_function_test.go:274–288  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

272}
273
274func TestRPCModeInvokeReaderErrorPropogated(t *testing.T) {
275 handlerResource := &closeableResponse{
276 reader: &readerError{errors.New("yolo")},
277 closed: false,
278 }
279 srv := NewFunction(newHandler(func() (interface{}, error) {
280 return handlerResource, nil
281 }))
282 var response messages.InvokeResponse
283 err := srv.Invoke(&messages.InvokeRequest{}, &response)
284 require.NoError(t, err)
285 assert.Equal(t, "", string(response.Payload))
286 assert.Equal(t, "yolo", response.Error.Message)
287 assert.True(t, handlerResource.closed)
288}

Callers

nothing calls this directly

Calls 3

InvokeMethod · 0.95
NewFunctionFunction · 0.85
newHandlerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…