Skip to content

Added readable error output #196

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 1 commit into from

Conversation

nikedlab
Copy link

No description provided.

@ghostsquad
Copy link
Contributor

@nikedlab why add more steps to find out the error? Why not just include the request body in the error?

messages += msg + "\n"
}

err := fmt.Errorf("Request failed. Please analyze the request body for more details. Status code: %d\n%s",
Copy link
Contributor

Choose a reason for hiding this comment

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

@nikedlab why add more steps to find out the error? Why not just include the request body in the error?

@ghostsquad
Copy link
Contributor

This PR is getting stale. I'll be closing in next week if no one is looking at it.

err := fmt.Errorf("Request failed. Please analyze the request body for more details. Status code: %d", r.StatusCode)
var jiraError JiraError
if jsonErr := json.NewDecoder(r.Body).Decode(&jiraError); jsonErr != nil {
fmt.Println("Response JSON decoding failed! Error: " + jsonErr.Error())
Copy link
Contributor

Choose a reason for hiding this comment

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

libraries shouldn't print directly to stdout.

@andygrunwald
Copy link
Owner

Stale PR.
If this Pull Request receives new activity, I will reopen it.
Thanks for taking the time.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants