(t *testing.T)
| 93 | func (e CustomError) Error() string { return "Something bad happened!" } |
| 94 | |
| 95 | func TestCustomError(t *testing.T) { |
| 96 | srv := NewFunction(testWrapperHandler( |
| 97 | func(ctx context.Context, input []byte) (interface{}, error) { |
| 98 | return nil, CustomError{} |
| 99 | }, |
| 100 | )) |
| 101 | var response messages.InvokeResponse |
| 102 | err := srv.Invoke(&messages.InvokeRequest{}, &response) |
| 103 | assert.NoError(t, err) |
| 104 | assert.Nil(t, response.Payload) |
| 105 | assert.Equal(t, "Something bad happened!", response.Error.Message) |
| 106 | assert.Equal(t, "CustomError", response.Error.Type) |
| 107 | } |
| 108 | |
| 109 | type CustomError2 struct{} |
| 110 |
nothing calls this directly
no test coverage detected
searching dependent graphs…