diff --git a/api/pkg/webhooks/client.go b/api/pkg/webhooks/client.go index e462794..526be0c 100644 --- a/api/pkg/webhooks/client.go +++ b/api/pkg/webhooks/client.go @@ -90,7 +90,7 @@ func (g *simpleWebhookClient) Invoke(ctx context.Context, payload []byte) ([]byt } resp, err := client.Do(req) if err != nil { - log.Errorf("Error making client request %s", err) + log.Errorf("Error making client request to webhook %s, err: %s", g.Name, err) return err } defer resp.Body.Close() @@ -103,7 +103,7 @@ func (g *simpleWebhookClient) Invoke(ctx context.Context, payload []byte) ([]byt } // check http status code if resp.StatusCode != http.StatusOK { - return fmt.Errorf("response status code %d not 200, err: %s", resp.StatusCode, content) + return fmt.Errorf("response from %s, status code %d not 200, err: %s", g.Name, resp.StatusCode, content) } return nil diff --git a/api/pkg/webhooks/mock_WebhookManager.go b/api/pkg/webhooks/mock_WebhookManager.go index 9cc21c9..a6ab32e 100644 --- a/api/pkg/webhooks/mock_WebhookManager.go +++ b/api/pkg/webhooks/mock_WebhookManager.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.1. DO NOT EDIT. +// Code generated by mockery v2.44.1. DO NOT EDIT. package webhooks @@ -31,6 +31,24 @@ func (_m *MockWebhookManager) InvokeWebhooks(_a0 context.Context, _a1 EventType, return r0 } +// IsEventConfigured provides a mock function with given fields: _a0 +func (_m *MockWebhookManager) IsEventConfigured(_a0 EventType) bool { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for IsEventConfigured") + } + + var r0 bool + if rf, ok := ret.Get(0).(func(EventType) bool); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + // NewMockWebhookManager creates a new instance of MockWebhookManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockWebhookManager(t interface {