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

Make errorHandler take error instead of string #66

Closed
wants to merge 2 commits into from
Closed

Make errorHandler take error instead of string #66

wants to merge 2 commits into from

Conversation

kinbiko
Copy link

@kinbiko kinbiko commented May 8, 2020

By submitting a PR to this repository, you agree to the terms within the Auth0 Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.

Description

Make error handler take an error instead of a string. This is a much more powerful API, especially since Go 1.13, as nested errors can now be extracted. I didn't introduce any %w wrapped errors as I wasn't sure which versions of Go you support.

This is technically a breaking change, as it changes the accepted values given to ErrorHandler in the Options struct. I did notice that there hasn't been v1 release of this package yet (technically v0.0.0-whatever still as reported in go.mod) so I'm raising this PR in the hope that breaking changes are still accepted.

Changes error messages to start with a lower case character.

Added missing note about what the default value is for ErrorHandler

References

Fixes #52.

Testing

Change can be tested by using the package as described and passing in an Extractor in Options that always returns an error.
Tests pass on my local MBP dev machine.

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
    • I have not checked the docs on auth0.com/docs.
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not master

@d10i
Copy link
Contributor

d10i commented Aug 10, 2020

Would love for this to be merged.

@kinbiko
Copy link
Author

kinbiko commented Nov 27, 2020

I'm closing this PR since this library is not maintained, I'm no longer interested in using Auth0, and I don't feel like maintaining my fork.

The PR (and thus the diff) should still be available should the team choose to maintain the package in the future.

@kinbiko kinbiko closed this Nov 27, 2020
@kinbiko kinbiko deleted the idiomatic-error-handler branch November 27, 2020 15:34
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.

Error handler interface is too restricted
2 participants