Skip to content

Improves logging of error responses.#9

Merged
ChezCrawford merged 1 commit intomasterfrom
fb/improved-error-handling-alt
Nov 10, 2020
Merged

Improves logging of error responses.#9
ChezCrawford merged 1 commit intomasterfrom
fb/improved-error-handling-alt

Conversation

@ChezCrawford
Copy link
Copy Markdown

@ChezCrawford ChezCrawford commented Nov 3, 2020

HTTP requests that return "error" status codes should now be properly logged.

@ChezCrawford ChezCrawford marked this pull request as ready for review November 3, 2020 14:48
} else if !r.IsRetryable(resp, err) {
if err == nil {
err = ErrAPIError
if resp != nil {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adheres to the RoundTripper interface by returning err == nil in the event an HTTP response is received.

The calling code in pkg/eventsapi/eventsapi.go only attempts to parse the response body if no err is returned so this helps there as well.

@ChezCrawford ChezCrawford force-pushed the fb/improved-error-handling-alt branch from e4d2595 to 8a5dfcd Compare November 3, 2020 15:36
@ChezCrawford ChezCrawford merged commit e046b42 into master Nov 10, 2020
@ChezCrawford ChezCrawford deleted the fb/improved-error-handling-alt branch November 10, 2020 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants