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

[ENHANCEMENT] Error hooks only run if the provider throws #1085

Closed
toddbaert opened this issue Sep 4, 2024 · 1 comment
Closed

[ENHANCEMENT] Error hooks only run if the provider throws #1085

toddbaert opened this issue Sep 4, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@toddbaert
Copy link
Member

Observed behavior

The error hooks only runs if the provider throws an exception. However, it's possible for a provider to return an error code in the ResolutionDetails. For clarity and flexibilty, we should consider resolutions that return an error code as errors; this will allow providers to signal errors without creating expensive strack traces, as well.

Expected Behavior

The error hook runs and resolution is considered erroneous if the ResolutionDetails contains an errorCode

Steps to reproduce

  1. Register a provider that returns a ResolutionDetails object with an errorCode
  2. Register a hook that relies on the error hook
  3. Evaluate a flag
@toddbaert toddbaert added enhancement New feature or request good first issue Good for newcomers labels Sep 4, 2024
@toddbaert toddbaert changed the title [BUG] Error hooks only run if the provider throws [ENHANCEMENT] Error hooks only run if the provider throws Sep 4, 2024
@toddbaert
Copy link
Member Author

This was done here: #951

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant