Skip to content

Commit

Permalink
chore: webhook add name to error msg & regenerate mock (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
bthari authored Aug 13, 2024
1 parent c4379b4 commit 83f620d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
4 changes: 2 additions & 2 deletions api/pkg/webhooks/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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

Expand Down
20 changes: 19 additions & 1 deletion api/pkg/webhooks/mock_WebhookManager.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 83f620d

Please sign in to comment.