Skip to content

Commit

Permalink
Merge pull request #278 from blockpane/feature/fix-nil-ref-CreateEven…
Browse files Browse the repository at this point in the history
…tWithHTTPClient

return nil instead of resp on error
  • Loading branch information
theckman committed Mar 7, 2021
2 parents 1a0c44e + baebca9 commit 4d8ea2c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion event.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func CreateEventWithHTTPClient(e Event, client HTTPClient) (*EventResponse, erro
req.Header.Set("Content-Type", "application/json")
resp, err := client.Do(req)
if err != nil {
return &EventResponse{HttpStatus: resp.StatusCode}, err
return nil, fmt.Errorf("failed to action request: %w", err)
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
Expand Down

0 comments on commit 4d8ea2c

Please sign in to comment.