(t *testing.T)
| 26 | ) |
| 27 | |
| 28 | func TestNewAPIError(t *testing.T) { |
| 29 | details := "Some internal error details" |
| 30 | apiErr := apierror.NewAPIError(apierror.ErrInternalServer, "Something went wrong", details) |
| 31 | |
| 32 | assert.Equal(t, apierror.ErrInternalServer, apiErr.Code) |
| 33 | assert.Equal(t, "Something went wrong", apiErr.Message) |
| 34 | assert.Equal(t, details, apiErr.Details) |
| 35 | assert.Equal(t, "INTERNAL_SERVER_ERROR: Something went wrong", apiErr.Error()) |
| 36 | } |
| 37 | |
| 38 | func TestMapErrorToHTTPStatus(t *testing.T) { |
| 39 | tests := []struct { |
nothing calls this directly
no test coverage detected