Skip to content
This repository was archived by the owner on Jan 12, 2023. It is now read-only.

Conversation

ahobson
Copy link

@ahobson ahobson commented Sep 3, 2020

  • Centralize config extraction and initialization
  • Auth middleware no longer continues if auth fails
  • POST dog sets content-type because it returns JSON

Andrew Hobson added 2 commits August 27, 2020 17:03
* Auth middleware no longer continues if auth fails
* POST dog sets content-type because it returns JSON
if err != nil {
validationErr := apperrors.NewValidationError(
errors.New("GET dog params failed validation"),
fmt.Errorf("GET dog params failed validation: %s", err),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not take it even one step further and use the wrapping %w verb introduced in Go 1.13?

Copy link
Author

Choose a reason for hiding this comment

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

Thank you! I'll confess that I remembered that the best practices for error handling in go had changed over time, but I didn't remember the right idiom.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants