(t *testing.T)
| 111 | func (e *CustomError2) Error() string { return "Something bad happened!" } |
| 112 | |
| 113 | func TestCustomErrorRef(t *testing.T) { |
| 114 | |
| 115 | srv := NewFunction(testWrapperHandler( |
| 116 | func(ctx context.Context, input []byte) (interface{}, error) { |
| 117 | return nil, &CustomError2{} |
| 118 | }, |
| 119 | )) |
| 120 | var response messages.InvokeResponse |
| 121 | err := srv.Invoke(&messages.InvokeRequest{}, &response) |
| 122 | assert.NoError(t, err) |
| 123 | assert.Nil(t, response.Payload) |
| 124 | assert.Equal(t, "Something bad happened!", response.Error.Message) |
| 125 | assert.Equal(t, "CustomError2", response.Error.Type) |
| 126 | } |
| 127 | |
| 128 | func TestContextPlumbing(t *testing.T) { |
| 129 | srv := NewFunction(testWrapperHandler( |
nothing calls this directly
no test coverage detected
searching dependent graphs…