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 errors more usable #15

Open
Nevon opened this issue May 23, 2022 · 0 comments
Open

Make errors more usable #15

Nevon opened this issue May 23, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@Nevon
Copy link

Nevon commented May 23, 2022

Describe the feature request?

Currently the verifier throws generic instances of Error when verifying tokens. The only way to act on these errors is by looking at the error messages, which can of course change and are generally difficult to work with. The worst offender is the claims verifier, which returns a single error with each claim "error" string concatenated together.

I would suggest instead extending the Error class with your own Error classes, as you are doing for ConfigurationValidationError, so that we can disambiguate between different types of errors. For cases where you want to throw multiple errors, such as for the claims verifier, extend AggregateError and have the errors be instances of InvalidClaimError (or whatever you want to call that error).

New or Affected Resource(s)

I don't know what a resource is in this context...

Provide a documentation link

No response

Additional Information?

No response

@Nevon Nevon added the enhancement New feature or request label May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant