Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Refactor error_source.go #1055

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Refactor error_source.go #1055

wants to merge 1 commit into from

Conversation

adamyeats
Copy link
Contributor

This PR includes a number of changes to error_source.go:

  • SourceError renamed to ErrorWithSource to be more explicit about intention. Arguments have been flipped so that err is passed in the first position to be more consistent with the other functions in the error_source package.
  • ErrorWithSource uses the functional options pattern to make it more extensible via ErrorSourceOptions, and make the bool passed as the last param optional (defaults to false). An override can be set by using calling WithOverride, e.g. ErrorWithSource(err, source, WithOverride())
  • Response renamed to ResponseWithErrorSource to be more explicit about intention

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.

1 participant